Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Find file & execute command
Name: hamim Date: December 13, 2004 at 01:51:45 Pacific OS: Sco Openserver CPU/Ram: 2 gig/2
Comment:
Hi I would like to run a command that goes to each sub directory on a file system.It 1st has to search through each directory & execute the command. I tried this but no luck: find . -type f filename -print |while read eg do prostrct list automate $eg done
PS: "prostrct list automate" is an external programme run by progress application
Name: Dlonra Date: December 14, 2004 at 13:50:35 Pacific
Reply:
Your original "find . -type f filename -print " is an erroneous find command.
If you want to: find all files named "automate.st" (assume 1 per directory) cd to the directory containing the file execute command "do.this" on the file then for f in $(find . -type f -name automate.st);do cd $(dirname $f);do.this automate.st;cd -;done
0
Response Number 5
Name: hamim Date: December 15, 2004 at 01:19:35 Pacific
Reply:
Hi
Thanks alot for your help -it works great Cheers!!!!
Summary: How do you find files, then copy the files into an existing directory. I am to find files starting with N which is not more than 10 days old, then copy the N files into an existing N directory. All in...
Summary: hi there, how to find files more than 90 days and copy it to another directory using HPUX/unix command? is the command same for unix or hpux ? ...
Summary: > find . -name 'text' | exec {} vnmr.awk "-exec" is part of "find", not a separate command, and "{}" stands for the current file name returned by find. The syntax for this would therefore be: find . -...