Link to home
Start Free TrialLog in
Avatar of MichaelAllen
MichaelAllen

asked on

Problem using 'find' with cygwin

Windows XP
Using cygwin

I have seen this question asked in many places but never seen the answer.

C:\>\cygwin\bin\find . -name \*.htm -exec cat "{}" \;
/usr/bin/find: missing argument to `-exec'

is not working properly

I have tried the follwoing
cygwin\bin\find . -name \*.htm -exec cat '{}' \;
cygwin\bin\find . -name \*.htm -exec cat '{}'\;
cygwin\bin\find . -name \*.htm -exec cat '{}' \;

What I have seen for answers are the use xargs

cygwin\bin\find . -name \*.htm -print | xargs  cat

Additionally, since the output of find is a complete path to the file includeing spaces I need to quote the output of the find command prior to passing it into any other utility.

-Thanks
Michael



Avatar of jkr
jkr
Flag of Germany image

I'd use that line

find . -name "*.htm" -exec cat {} \;

Works fine, for years now...
ASKER CERTIFIED SOLUTION
Avatar of F. Dominicus
F. Dominicus
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial