Results 1 to 4 of 4
Originally Posted by wassy121
you can run -exec with multiple commands, but not multiple -exec flags. For instance:
find . -name "*.txt" -exec ls {} \&\& ls {} \;
Hello ...
- 01-16-2008 #1Just Joined!
- Join Date
- Jan 2008
- Posts
- 2
-exec?
Hello Wassy, no unfortunately that won't work, at least here on my ubuntu this happens:
and same especially with "|".Code:find . -name "*.mp3" -exec ls {} \&\& ls {} \; ./stuff/test.mp3 ./stuff/test.mp3 ls: &&: No such file or directory ls: ls: No such file or directory
Anyone knows how to solve this? I actually would like to be able to do an exiftool of some files, and directly save a log of its result in the same folder, but using | and tee will result as the example above, and using ">" will save in the folder I'm running find in.
Any help welcome!
Vorrin TalLast edited by devils casper; 01-16-2008 at 05:59 PM. Reason: added [code].......[/code] tags
- 01-16-2008 #2
- 01-16-2008 #3Just Joined!
- Join Date
- Jan 2008
- Posts
- 2
Thanks anomie!
That's already a step forward, but it still won't log the output of the previous command... basically what I would need is for this to work:
Code:find . -name '*.doc' -exec file {} \| tee test.log \;Last edited by devils casper; 01-16-2008 at 06:00 PM. Reason: added [code].......[/code] tags
- 01-16-2008 #4Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
A sample how to use the file command for the found files and write the output of the found files to your logfile:
RegardsCode:file $(find . -name '*.doc' | tee test.log)



Reply With Quote