I'm trying to write a script to unify two separate commands I run by hand into a single bash script I can then cron.
The first command is a simple find on files with a certain name and size
find /some/path -type f -name file.pl -size +10M
This will produce several matching files and their full path. I then copy these paths by hand into a for loop as arguments to the next script.
for path in /some/path/1/file.pl /some/path/2/file.pl /some/path/3/file.pl ; do perl /my/script.pl $path ; done
Seems like it should be easy to get this into a single shell script but finding it a struggle.
$(command)
and\
command`` are equivalent, but I think$(command)
is more readable. – ctrl-alt-delor Aug 14 '14 at 11:23