I want to loop through files in a directory but omit the file with the latest date in my list of files. How would I accomplish this?
Thanks
I want to loop through files in a directory but omit the file with the latest date in my list of files. How would I accomplish this?
Thanks
This will select each file in time order, oldest first, except for the newest...
for file in $(ls -tr|sed '$d')
do
: something with $file
done
Thanks Ygor!