The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



Thread: simple script
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-22-2008
ali560045's Avatar
ali560045 ali560045 is offline
Registered User
 

Join Date: Oct 2007
Posts: 299
simple script

i have a script that check for the last date entry made in a series of files
--------------------------------------------------------------------

a=`date +"%Y-%m-%d"`

for i in *.log*
do
cat $i | grep $a

echo $i >> file1.txt
echo $a >> file1.txt
done
-----------------------------------------------------------------------

but this format of date i,e "a" checks for current/today date .

i want the date that checks the last date put into that files.the format should be same as y-m-d
-----------------------------------------------------------------------
Reply With Quote
Remove advertisements
!!
Forum Sponsor