How would you parse a date in bash, with separate fields (years, months, days, hours, minutes, seconds) into different variables?
The date format is: YYYY-MM-D
YYYY-MM-D
another pure bash
$ d="2009-12-03 15:35:11" $ d=${d//[- :]/|} $ IFS="|" $ set -- $d $ echo $1 2009 $ echo $2 12 $ echo $@ 2009 12 03 15 35 11