starlite79
Technical User
Hi,
I would like to create a list of the 15 most recent files in a directory. So far I've used the command
ls -rt | tail -15
My question is: How do I assign this to a variable, say LIST, and then copy the list to a file, as in
cp $LIST > $INPUT_LIST ?
My goal is to use this list in a Fortran program to read those 15 files as input.
I am using Korn shell.
I would like to create a list of the 15 most recent files in a directory. So far I've used the command
ls -rt | tail -15
My question is: How do I assign this to a variable, say LIST, and then copy the list to a file, as in
cp $LIST > $INPUT_LIST ?
My goal is to use this list in a Fortran program to read those 15 files as input.
I am using Korn shell.