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
instead of using the shell scripting,incorporate in your scripting itself like below wheever you need:
a=date +%Y b=date +%S c=date +%H
a will be year b will be seconds c will be hours. and so on.