Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / January 2006



Tip: Looking for answers? Try searching our database.

How do I pass unix FIND arguments to CFEXECUTE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chris2oz - 30 Jan 2006 07:06 GMT
/usr/bin/find /filepath -type f -name '*.cfm*' -exec grep -i -l ' ' {} \; works
in unix.

Why doesn't the following work in cf:

<cfexecute name="/usr/bin/find" arguments="/filepath -type f -name '*.cfm*'
-exec grep -i -l ' ' {} \;" timeout="60">
</cfexecute>

Thanks.
La Fougere - 30 Jan 2006 17:02 GMT
According to the doc cfexecutes takes the argument string as an array delimited
by spaces.  You could  enclose the whole argument string in quotes or pass the
arguments as part of the command.

Try those:

<cfexecute name=" /usr/bin/find /filepath -type f -name '*.cfm*' -exec grep -i
-l ' ' {} \;">

<cfexecute name="/usr/bin/find" arguments="#chr(34)#/filepath -type f -name
'*.cfm*' -exec grep -i -l ' ' {} \;#chr(34)#">

I can't test it from here so a little tweaking might be necessary.
chris2oz - 30 Jan 2006 23:25 GMT
Thanks for the suggestion. I've tried passing the arguments in the name and
numerous quote arrangements to no avail. Just in case, I added "/usr/bin/" to
the grep. Again, it works at the command line but not in a cfexecute tag, which
gives no output.
chris2oz - 30 Jan 2006 23:54 GMT
Ok. I think I've isolated the problem down to the single quotes. The following
works:

<cfexecute name="/usr/bin/find" arguments="/filepath -type f -name *.cfm*"
timeout="60">

How can I escape the single quotes? I've tried two single quotes.

Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.