How to add the info from read into a list?
Hi, I'm trying to read the user's input and store them in a list using a while loop. I came up with the following code but it just adds a new input each time and deleting the previous input instead of storing them all. Also I'm using -1 to quit the program but current setup will insert the -1 into the list too which I want to avoid.
I'm new to linux. any guidance is appreciated. Tnks in advance. :)
while [ $userInput -ne -1 ]
echo "Enter any number. Enter -1 to quit"