![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simple Script | mojoman | Shell Programming and Scripting | 6 | 05-12-2008 12:55 AM |
| simple script | ali560045 | Shell Programming and Scripting | 1 | 01-22-2008 12:41 AM |
| Simple Script Help | Skunkie | UNIX for Dummies Questions & Answers | 4 | 10-02-2006 08:18 AM |
| simple awk script... | moxxx68 | Shell Programming and Scripting | 3 | 01-24-2005 12:17 AM |
| simple script | hedrict | UNIX for Dummies Questions & Answers | 4 | 02-23-2004 12:15 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
| Forum Sponsor | ||
|
|
|
|||
|
Hello,
Yiou can find out the latest day and month by using the following command : day=`ls -lrt *.log | tail -1 | awk '{printf("%2d",$7)}'` mon=`ls -lrt *.log | tail -1 | awk '{print $6}'` for file in `ls -l *.log | grep "$mon $day" do ... done |
|
|||
|
Quote:
Thanks Nagarajan G |
|
||||
|
i checked that way ,but thats not the effective way in my case....
actually my files will contain some dates in it in the format y-m-d.so i need to do cat filename | grep "the latest date" i have to go inside the file to serch the latest date....... so asking how to grep the latest date inside file |
||||
| Google The UNIX and Linux Forums |