Hi all,
I wrote a script that reads inputs from user and store in array named "input". The number of elements in the array is not fixed - determined only after user exit the while loop that reads the array values :
x=1
echo "Enter first value"
read input[$x]
while [ ${input[$x]} != "exit" ]
do
x=$((x + 1))
echo "Another value? (type exit to end) "
read input[$x]
done
Then I would like to print each of the array contents from input[1] until user exits. How can I do that?
Using for i in $input does not work for me.. please guide :o