How do I format a date in a KornShell (ksh) script to DD-MON-YYYY?
I have tried the following:
date '+%d-%h-%Y'
It returns 04-Nov-2009 I need for the Nov to be NOV (all caps). Can this be done with the date utility?
How do I format a date in a KornShell (ksh) script to DD-MON-YYYY?
I have tried the following:
date '+%d-%h-%Y'
It returns 04-Nov-2009 I need for the Nov to be NOV (all caps). Can this be done with the date utility?
This is what finally worked on unix(solaris).
returned: 04-NOV-2009
The ^ character forces uppercase in the GNU coreutils
date
(at least, it does in version 6.9.92.4 of coreutils):Unfortunately, ^ is not POSIX standard for
date
, so you'll probably have to resort to a second command such as thetr
suggested by @martin clayton, if you aren't on a GNU system.You could uppercase it yourself if caret uppercase is not supported in your environment: