Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick, easy, shell-scripting questions

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi All,

Here's a quick question for you from a lowly DBA who knows very little about shell scripting!

I've got a script that accepts a filename, then does various things to the files. I just want to add a bit in the front where it will read in a Y or N from the operator. If they type in Y it should just carry on with the script, if it's an N then it should simply exit.

Any suggestions on syntax I can use to achieve this?

Thanks,

Simon
 
try something like this

echo " 1. continue"
echo " 2. exit"
read choice
if [ $choice -eq 1 ]
then
<routine>
else
<routine>
fi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top