Hi,
I am new to shell scripting.So someone please do help me out.I have stored two dates in the given format below.
cur_time=`date '+ %b%e%T'`
time=`ls -lu f1 | cut -d "" -f6`
I hope both these will show the dates in this format.
for eg. Dec 23 10:10
Now I want to compare the contents of variable time with that of cur_time and delete the file if time is 48 hours before cur_time.Please help me with the necessary shell script or if there is a better option please let me know.I want to write a function for this.This is how I started.
delete()
{
cd /home/julie/trash
cur_time=`date '+ %b%e%T'`
for i in `ls-lu`
do
time=`ls -lu $i| cut -d "" -f6`
Help me finish this function.
Regards,
Toms