PDA

View Full Version : [ubuntu] Shell Script



bobthebob1234
May 22nd, 2008, 11:39 AM
Hello.

I am trying to make a shell script to search for a directory for a folder called todays date.

I can get the date, but how would I format it to DD Month YYYY (eg 22 May 2008)

How would i do this?

Thanks

kerry_s
May 22nd, 2008, 12:34 PM
not sure i understand. try reading> man date
according to the man pages the format is> %j %m %Y

wdaniels
May 22nd, 2008, 12:40 PM
%b should give you the full month name if that's what you want:


date +"%m %b %Y"

bobthebob1234
May 22nd, 2008, 08:33 PM
Thanks, thats perfect!