gundu
1
I am trying to assign list of files that created that day to a variable 'filename'
filename=`ls -ltr |grep "Mar 6" | awk '{print$9}'`
If there are no files created that day, my script just hangs, i need help with some login here.
i am also trying to figure out a way to look for files that are created , say for ex: yesterday Mar 9. I am trying with
DATE=`date +%b`
DATE1=`date +%d`
tem="$DATE $DATE1"
If I give one more space it won't reconize date. Need help
Thanks,
Gundu
You need to post more of your script. I dont see why the code you posted would make the script hang.
gundu
3
OK , the 1st part is fixed, i tried with string not null, and it is OK.
My next and big problem is DATE
When I do ls -ltr , I get
-rw-r--r-- 1 xxxxx xxxx 2428 Mar 9 16:13 auditabcd
I am trying to look for the files belong to current date. I declared as :
DATE=`date +%b`
DATE1=`date +%d`
tem="$DATE $DATE1"
If I give one more space it won't reconize date. Need help
Thanks,
Gundu
$ date
date
Thu Mar 9 17:13:57 EST 2005
$ date +%d
09