- Code: Select all
date | cut -c5-11,25- | sed 's/\([0-9]\{1,2\}\)/\1,/'
The output is the following:
- Code: Select all
May 8, 2012
I tried altering the sed syntax to something like the following, where the max string, which used to be 1, 2 is changed to 1, 4 like so:
- Code: Select all
date | cut -c5-11,25- | sed 's/\([0-9]\{1,4\}\)/\1,/'
and it still outputs the following:
- Code: Select all
May 8, 2012
I thought maybe if the computer would see that there are four number strings as max instead of two, it would take 2012 into consideration, and would probably output this:
- Code: Select all
May 8, 2012,
What is the error of my thinking?




