Hello and thanks in advance.
I need to take a file, insert the filename as the first line of the file, then move to a different name. Here's the wrinkle. I need to grab the oldest file in the format of
ORIGFILE_YYYYMMDD.TXT and save it as
NEWFILE.TXT. For this example, let's say the file name is
- Grab oldest file (
ls -tr ORIGFILE*.txt)
ORIGFILE_20151117.TXTas first line of file