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 radoulov 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   -   Original Discussion by seanbyrne
radoulov's Unix or Linux Image
radoulov radoulov is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 9 January 2017, 4:40 AM EST
Location: Варна, България / Milano, Italia
Posts: 5,690
Thanks: 184
Thanked 630 Times in 587 Posts
Just quote the identifier:


Code:
bash-3.2.48(21)[~]$ CURRENT_DATE="$(date +"%a %b %e")"
bash-3.2.48(21)[~]$ echo $CURRENT_DATE 
Fri Jan 9
bash-3.2.48(21)[~]$ echo "$CURRENT_DATE"
Fri Jan  9