?
Solved

Problem using 'find' with cygwin

Posted on 2006-05-27
2
Medium Priority
?
2,723 Views
Last Modified: 2013-12-03
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



0
Comment
Question by:MichaelAllen
2 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 16775880
I'd use that line

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

Works fine, for years now...
0
 
LVL 24

Accepted Solution

by:
fridom earned 1000 total points
ID: 16779600
You use it from within cmd.exe. Maybe that is your problem. Start a unix shell and try the line and that should do the trick or run it with something like
sh -c 'find .... ' ..

Regards
Friedrich
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question