Problem with date command

Hi,

I wish to display date say 25th Jan, 2008 in format '25-1-2008'
i.e. month should be displayed as '1' and not '01'.
I wish that 0 should not be displayed in month.

Thanks
Rochit

Use the %e format specifier

Oops - my bad - I thought you wanted the day of the month. Can't delete the post.

 date +%d-%m-%Y | sed 's/-0/-/'
date '+%d %m %y' | awk '{printf "%0.2d-%d-%0.2d",$1,$2,$3}'

is a hacky way of getting it....

On hpux....
ant:/home/vbe $ date "+%d-%0m-%Y"
25-1-2008
ant:/home/vbe $