Quantcast
Channel: Appending a current date from a variable to a filename - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 6

Appending a current date from a variable to a filename

$
0
0

I'm trying to append the current date to the end of a file name like this:

TheFile.log.2012-02-11

Here is what I have so far:

set today = 'date +%Y'
mkdir -p The_Logs &
find . -name The_Logs -atime -1 -type d -exec mv \{} "The_Logs_+$today" \; &

However all I get is the name of the file, and it appends nothing. How do I append a current date to a filename?


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>