Code: Select all
date | cut -c5-11,25- | sed 's/\([0-9]\{1,2\}\)/\1,/'
Code: Select all
May 8, 2012
Code: Select all
date | cut -c5-11,25- | sed 's/\([0-9]\{1,4\}\)/\1,/'
Code: Select all
May 8, 2012
Code: Select all
May 8, 2012,
Code: Select all
date | cut -c5-11,25- | sed 's/\([0-9]\{1,2\}\)/\1,/'
Code: Select all
May 8, 2012
Code: Select all
date | cut -c5-11,25- | sed 's/\([0-9]\{1,4\}\)/\1,/'
Code: Select all
May 8, 2012
Code: Select all
May 8, 2012,
Code: Select all
date +'%B %-d, %Y,'
Code: Select all
May 9, 2012,
Code: Select all
date | cut -c5-11,25- | sed 's/\([0-9]\{1,4\}\)/\1,/g'
That's right! How did I forget about that?!?xenopeek wrote:You know that you can specify the output format of date
Or to do it with sed, include the g modifier at the end to indicate you want to do the substitution globally (repeatedly, instead of just the first occurrence).Code: Select all
date | cut -c5-11,25- | sed 's/\([0-9]\{1,4\}\)/\1,/g'