Computing.Net > Forums > Unix > add date to filename

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

add date to filename

Reply to Message Icon

Name: gjoob
Date: February 19, 2003 at 06:59:36 Pacific
OS: Compaq Tru64 Unix
Comment:

I have written a script to automatically ftp a file from one server to another. I want to add the date and time to the extension of my file name.

If my script has target_name=library. how do I add the current date to the extension?




Sponsored Link
Ads by Google

Response Number 1
Name: Nish
Date: February 19, 2003 at 21:04:56 Pacific
Reply:


mv Your_FIle_Name Your_FIle_Name.`date '+%y%m%d_%H%M'`
Hope this helps !


0

Response Number 2
Name: gjoob
Date: February 20, 2003 at 03:15:07 Pacific
Reply:

Thanks Nish, that worked a treat


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: add date to filename

ksh yyddd (julian date) to yyyymmdd www.computing.net/answers/unix/ksh-yyddd-julian-date-to-yyyymmdd/6471.html

Assign Date to a Var www.computing.net/answers/unix/assign-date-to-a-var/3915.html

Date To Second Convert Vice Versa www.computing.net/answers/unix/date-to-second-convert-vice-versa/5262.html