I have 4 lists of variables like this:
YEAR1="2008 2008 2009"
YEAR2="2008 2009 2009"
MONTH1="11 12 01"
MONTH2="12 01 02"
I want to pipe them through to a Python script in a way that the first items from all 4 lists are input first, then the second items from each list and so on. I believe I need to use a WHILE loop for this, but mine doesn't work. I don't get an error message either.
while read $YEAR1 $YEAR2 $MONTH1 $MONTH2;do
python python-code.py "$YEAR1" "$MONTH1" "$YEAR2" "$MONTH2"
done
My Python script is tested and works, I'm just not getting my head around bash scripting.