Hello,
I've created a couple of files within a list using the command "ls -ltr | tail -2 > list" These files are the newest files placed within a directory. From the "list" file, I need to place the filenames as a variable. In which the newest file will be called "new_ctrl" the older file called "old_ctrl".
Here is the "list" input file (after using awk to list the date & filename):
Sep 12 11:06 cms38_Sep12.log
Sep 29 11:29 cms38_09_25_09.log
What I need:
new_ctrl="cms38_09_25_09.log"
old_ctrl="cms38_09_25_09.log"
I'm using BSH.
Your help would be greatly appreciated here.
Thank you for your time.
Pete
---------- Post updated at 09:43 AM ---------- Previous update was at 09:42 AM ----------
Sorry - Mistake on ctrl file output:
new_ctrl="cms38_09_25_09.log"
old_ctrl="cms38_Sep12.log"