hello experts,
H r u . i just need to get the previous file from the latest file let say.
fileA
fileB
fileC
fileD
fileE
in this case fileE is the latest file but i need a script which will always get the name of the previouse file like fileD.
currently i am using this command to get the file.
filename=`ls -1rt|tail -2|head -1`
echo $filename
fileD
But i dont want to use this methaod is there is any other way to achive this task.
Please help me out
Regards,
shary