Computing.Net > Forums > Unix > Date format 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.

Date format to filename

Reply to Message Icon

Name: anilcgowda
Date: August 11, 2005 at 15:39:00 Pacific
OS: UNIX
CPU/Ram: 1GB
Comment:

Hi,

I want a filename to be created with the date at the end of it(not the timestamp) in the format filename_YYMMDD.
My command in shellscript would be:
filename=filename_YYMMDD.

filename=filename_`date '+%y%m%d%H%M%S'` gives time also. If I specify filename_`date`, it doesn't come in YYMMDD.

Can you help me get the filename in yymmdd format.

Thanks,
Anil



Sponsored Link
Ads by Google

Response Number 1
Name: vicchai
Date: August 11, 2005 at 20:15:02 Pacific
Reply:

Try this:

filename=filename_`date +%y%m%d`
echo $filename


0
Reply to Message Icon

Related Posts

See More


Run a win32 file from map... Input parameters to shell...



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: Date format to filename

change date format using shell www.computing.net/answers/unix/change-date-format-using-shell/6741.html

Time diff and date formatting prob www.computing.net/answers/unix/time-diff-and-date-formatting-prob/5065.html

Prb in Yest'days Date Format www.computing.net/answers/unix/prb-in-yestdays-date-format/4559.html