I have this string: 2012-04-10_08-00 How can I parse this to year, month and day? Why wouldn't something like this work? read Y M D h m s <<< ${timestamp//[-_]/ }