Quote:
while echo "first input>"
read firstinput
[ $firstinput != 'x' ]
do
|
The general form of while is:
while <expr>
do
.
.
done
In your case, <expr> is everything in bold, which does not look like it's going to work.
Also, there's nothing to break you out of the loop based on the second and third entries
I would do it like this (pseudo-code---not checked--maybe not even correct BASH...

):
count =1
while [ $count -lt 4 ]
do
echo "enter data: "
if [ $data = "x" ]; then break
else
entry[count] = $data
count += 1
done
The idea is to read into the same variable each time, so you only have one test for "x". When it sees no "x", then it stuffs the data into an array.