I apologize for the title but I am not even sure myself what to call this. I am going to use an example of a pizza delivery. I need to make an interactive script that allows users to order a certain number of pizzas, and then choose what they want on each pizza. Here is my code so far....
#!/bin/bash
#Set variable for number of pizzas
read -p "How many pizzas would you like to order? " VarPizza
#Loop until user enters vaild tag number
until echo $VarPizza | grep -sq "^[+]*[0-9][0-9]*$"
do
read -p "Please enter a valid integer " VarPizza
done
#This is where I need help. This needs to loop however many times, based on the amount of pizzas someone orders. So if $VarPizza = 3....it needs to loop 3 times so they can choose what is on the pizza
while true [ $VarPizza ]
do
read -p "What toppings would you like" Toppings
done
This is the part I am unsure of. I need to know how to have a loop that stores each "topping". Would I use an array? Thanks in advance for any help