while echo "first input>"
[ $firstinput != 'x' ]
The general form of while is:
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...
while [ $count -lt 4 ]
echo "enter data: "
if [ $data = "x" ]; then break
entry[count] = $data
count += 1
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.