I am looking to capture input into variables that I can assign to an array. However, I must be able to capture a string with spaces. I imagine that can't be too hard, but it has illuded me thus far.
EG:
However, that just captures the first nine words.
should yield
LINE[1]=this is the first variable
LINE[2]=This is the second
I am really stuck here. Any help would be greatly appreciated.
EG:
Code:
#!/usr/local/bin bash
LINES=9
declare -a LINE=($1 $2 $3 $4 $5 $6 $7 $8 $9)
for (( c=0; c<$LINES; c++ ))
do
echo "{LINE[$c]} = "${LINE[$c]}
done
However, that just captures the first nine words.
Code:
./box this is the first variable::This is the second
LINE[1]=this is the first variable
LINE[2]=This is the second
I am really stuck here. Any help would be greatly appreciated.