SH SCRIPT +pulling information from a text file
Hi everyone,
I am writting a sh script to automatically copy my log files to another location and then clear the old ones.
the problem is that I dont want these scripts to overwrite each other so i need to add the date to the filename
the command I am using looks like this:
cp access.log history/access_$DATE.log (i have cut out the complete path)
but i want to be able to import the date information from a text file.. (or even better have the script discover the date for itself)
at the moment i have the command
date -d, --date= +%Y%m%d > date.txt
which works fine... however i dont know how to get the SH script to read the information from that file
any idea?
at the moment i have the DATE="date.txt"
which leave the filename access_date.txt.log
Thanks
Chris
|