Skip to main content
Participant
January 7, 2009
Question

cfexecute and special characters

  • January 7, 2009
  • 2 replies
  • 641 views
I would like to execute an awk command via cfexecute but fails:

awk '/start(.*?)end/' a.txt

pls kindly advise.
    This topic has been closed for replies.

    2 replies

    Participant
    January 8, 2009
    none of the below worked:

    <cfexecute
    name="/bin/awk"
    arguments="/start%20.%20end/ a.txt">
    </cfexecute>

    <cfexecute
    name="/bin/awk"
    arguments="/start . end/ a.txt">
    </cfexecute>
    Inspiring
    January 8, 2009
    Try enclosing the command with spaces in double quotes, so it is treated as a single unit.

    <cfexecute
    name="/bin/awk"
    arguments='"/start . end/ a.txt"'>
    </cfexecute>
    Participant
    January 7, 2009
    if there are spaces, execution fails:

    awk '/end (.*?) end/' a.txt

    pls advise how to represent spaces. I have tried

    awk '/end%20(.*?)%20end/' a.txt

    without luck!
    Inspiring
    January 7, 2009
    What does your cfexecute code look like? Are you passing the command into the "arguments" attribute?