BASH - read each line of text file to create a new one.

I have a BASH script that creates a directory of the current date, downloads files via psftp into that current date directory, then creates a text file of the list of files in that current date directory via this command:

ls *.bak > $DATE.list

My $DATE. list text file, for example 20071012.list, looks like this:

Now what I need to do is create another text file called $DATE.del which will add the command 'del' to the beginning of each like in the 20071012.list file and place 'quit' at the last line, for example 20071012.del would look like this:
del 20070928-accept.txt
del 20070927-accept.txt
del 20070928-beyond.txt
del 20070925-moved.txt

This has pushed my knowledge of BASH to its limit and I would appreciate any direction on this script.
Who is Participating?
ozoConnect With a Mentor Commented:
while read f ; do  echo del $f ; done < $DATE.list >$DATE.del
echo quit >> $DATE.del
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.