#!/bin/bash
echo "Please enter your Host Name"
read hname
echo "You have entered $hname, is this correct?"
select yn in "Yes" "No"; do
case $yn in
Yes ) sh runscript.sh; break;;
No ) ;
esac
done
How can I make this work so that if answer is incorrect go back to ask it again?
I know I need a while loop to achieve this but don’t know how to write it up.
This ought to do it: