I want to examine a directory and execute a command for each matching folder. The following find
correctly returns the list I'm looking for.
find . -maxdepth 1 -name "*.bitbucket"
For each item returned, I want to execute the command:
hg pull --update --repository [FIND_RESULT_HERE]
Is there a simply way to do this using find and xargs? If not, what's the best alternative.
-depth
means to process files first instead of dir, and it doesn't take any arguments. Maybe-maxdepth
? – MetroWind Jun 03 '11 at 16:02