Tuesday, July 29, 2008

Prompt to continue in a BASH script


# Present a prompt to procees or skip if noprompt_flag is set to 1.
# Uses a variable name of $noprompt_flag to show the prompt or not.
if [ $noprompt_flag = 1 ];
then echo -n ""
else
echo -n "Hit enter to change files, and restart servers. Ctrl-C to exit."
read continue
fi

No comments:

Post a Comment

My only disclaimer is that I reserve the right to delete any comment I think is insincere and/or rude.