Thursday, May 2, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 1983  / 2 Years ago, sun, august 28, 2022, 10:00:18

So I have my program and I cannot figure out how to make the program loop back to the start. I have more of a program however this is the part where I would like the program to restart if I picked yes exit 0 and exit 1 are placeholders at the moment since I do not know how to make it loop. Thank you for your help in advance.



echo "Is that all sir? (Yes/No)"

if [ $word = "Yes" ]
then exit 0

if [ $word = "No" ]
then exit 1

fi

More From » command-line

 Answers
7
response=no
while [[ "$response" != "yes" ]]
do
echo "Is that all? (Yes/No)"
read -r response
done


References and advice:




[#26157] Monday, August 29, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
skaing

Total Points: 462
Total Questions: 124
Total Answers: 113

Location: Nauru
Member since Thu, Feb 2, 2023
1 Year ago
skaing questions
;