list recursively files with for
Hi,
i want to build a bash script that do the following: for each java file found recursively in directory structure of n-layers execute a command. Thanks, Pedro |
what's the command you want to execute. normally, using find will do what you want
Code:
find /dir -type f -name "*.java" -exec "somecommand" {} \; Code:
find /dir -type f -name "*.java" -print | xargs "somecommand" |
And, what bash script should i write to build the following:
for each java file found recursively in directory structure of n-layers execute a command for that file. Sorry, but i'm a newbie in bash. Thanks. |
I've tried to execute this command:
Code:
find . -type f -name "*.java" -print -exec 'cleartool.exe mklabel LABEL' {} \; Quote:
Can you help me? Thanks, Pedro |
The quotes make bash think 'cleartool.exe mklabel LABEL' is one big command name. The {} should be in quotes:
Code:
find . -type f -name "*.java" -print -exec cleartool.exe mklabel LABEL '{}' \; |
Thank you.
Sorry for my ingnorance in bash scripts. |
You don't need to apologise, no one is born knowing about shell scripting :)
|
All times are GMT -5. The time now is 01:48 PM. |