Quote:
|
Originally Posted by lorcan
Aigles, Just a small correction in your code,
to get the latest file we have to sort based on the time,
so the 4th line should have been like
Code:
last_file=$(ls -t1 $filename.$datestamp.* 2>/dev/null | tail -1)
|
normally if used with tail -1, we would want ls -1tr instead. however for this particular case,i think because the filenames are already timestamped , with a number at the back, when doing ls -1, its still "sorted" to latest file.