I need to get the last generated file in a directory using ls -ltr. I need to store the output of ls -ltr in a variable.
it will like this
$xyz = -rw-rw-r-- 1 sblp003 siebel 1060 Dec 18 13:33
from this output, I need to do a substring to get this value alone "Dec 18 13:33". Can you guys please help me write a shell script to implement this logic.
thanks for the reply. small modification to myy above requirement. I need to do ls -ltr for files starting with this 'eCustomerCME*'. Pls help me do this. thanks a lot!!
ur code is working exactly as i expected. thanks! just a small modification, it has to do a ls -ltr only for files starting with 'eCustomerCME'. I would basicall search for eCustomerCME*. thanks