||11-11-2008 12:13 PM
Proper Syntax for If...Then..Else statements with a script
Hi there --
I am writing a script the prompts the user to enter a directory path, and then prompts the user to provide a hardware device file. Listed below is the part of the script that is involved with this issue:
# Prompt the user for the directory in question
echo "Please enter the full path of the directory:"
# Confirm the directory that was entered is the correct one
echo "Is this the correct directory? [y/n]"
# Prompt the user for the full pathname of the destination tape drive
echo "Please enter the full devicefile name of the tape drive: "
# Confirm the devicefile that was entered is the correct one
echo "Is this the correct device filename? [y/n]"
After the user enters the appropriate information after each prompt, the script will ask for confirmation. What I need help with is the correct syntax to use in each case so that if the answer is "y" the script will continue onward, if it is "n" the user will be prompted to re-enter the information.