Unix/Linux Go Back    



Keeping padding in a date field

Shell Programming and Scripting




Kindly Note - This is a Single User Post by Forum Member Ikon Regarding:
Keeping padding in a date field.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 01-09-2009
Ikon's Unix or Linux Image
Ikon Ikon is offline Forum Advisor  
Computer Geek
 
Join Date: Jul 2008
Last Activity: 15 January 2015, 10:57 AM EST
Location: Frederick, MD
Posts: 748
Thanks: 4
Thanked 11 Times in 10 Posts
Why not use:

Code:
# date +"%a %b %d"
Fri Jan 09

It keeps 2 digit date.

%e does pad on my RedHat box:

Code:
# date +"%a %b %e"
Fri Jan  9

EDIT:
Ahh I get it now.. Just do what radoulov says....