Using kernel 2.6.x
GNU bash, version 4.3.42(1)-release (arm-openwrt-linux-gnu)
In a bash script, how would you write a for loop that produces the following result with the variables below ?
command option option abc option 10
command option option def option 20
VAR1="abc def"
VAR2="10 20"
I can iterate $VAR1, but I don't know how to iterate $VAR2.
for i in $VAR1; do
command option option "$VAR1" option "$VAR2"
done
Should the command line be split into two strings, iterated separately and then concatenated ?
How about using a count variable with an array ? For example ...
count=1
echo ${VAR1["$count"]}
Could a count variable with a while loop work ?