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.
Search for file within shell
Name: hismail Date: June 17, 2005 at 06:27:18 Pacific OS: Sco Openserver CPU/Ram: 2 gig
Comment:
Hi I have a script that searches for the last file modified & runs two differnt commandeds to apend to another file. I have aproblem with my find as it cannot find the file if I run the script from the parent directory.
#!/bin/ksh LOG=`ls -lt day*.log|grep "^-" |head -1 |awk '{print $NF}'` STARTFILE=`head -6 $LOG >/tmp/HOME` ENDFILE=`tail -l |grep Logfile $LOG>>/tmp/HOME` for f in $(find /home/sing* -type f -name $LOG);do cd $(dirname $f);$STARTFILE;$ENDFILE;cd - done
Summary: How can i search for files and directories foe this set of files. the command line of how the scrupt should be exited is $ script5 /export/home/studen1 myfile1 myfile2 script5 - name of the shell scr...
Summary: You don't specify a language preference, so I'm going to pick the easiest for the task described. But depending on exactly what you want to do, there may be better answers. grep is a shell script com...