I have a String Variable possible having combinations of Values as Below -
v="2020-01-2020-04,2020-11"
I want the Above values to be converted to an Array as below-
array=(2020-01,2020-02,2020-03,2020-04,2020-11)
Can anyone please help me how can i implement this and interpret the Range part and extract the data in Array accordingly?
Note the Values in the String are Monthdate in Format YYYY-MM
I have tried it using the Below code to Split based on "," but not able to handle the Range-
IN="2020-01-2020-04,2020-11"
arrIN=(${IN//,/ })
echo ${arrIN[1]}