Date: Sun, 05 Mar 2000 12:57:34 -0500 From: Scott Gregory <bsdbox@citizen.infi.net> To: courtney@whtz.com Cc: questions@FreeBSD.ORG Subject: Re: using date for file names Message-ID: <38C2A00E.3C0EA4FF@citizen.infi.net> References: <85256899.005BCA3F.00@mail.whtz.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Use something like the following: TODAY=`date +%Y%m%d` # Set today to YYYYMMDD mv your.file $TODAY.doc man date for other output formats. I would recommend using the format above since it allows you to easily list files by date without relying on the datestamp of the file. Scott courtney@whtz.com wrote: > > hey everyone- > > I am looking to rename a file on a nightly basis with the current date > (i.e. original.txt will become 030500.doc at midnight tonight) and so > on...what command do I have to use in my shell script to get this working?? > > thanks! > > bern > > Bernie Courtney > Z100 New York Engineering > mailto:courtney@whtz.com > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?38C2A00E.3C0EA4FF>