First off, thanks for the earlier responses concerning a discussion for shell scripting.
Now
Heres my question. Bourne shell script with the following
echo "Do you want something (y/n)?"
while true;do
read answer
if [ "$answer" = Y -o "$answer" = y ]
then
DO A COMMAND HERE
break
elif [ "$answer" = N -o "$answer" = n ]
then
echo "Skipping to the next step"
break
fi
done
Any suggestions on shortening this alot. I dont want to repeat it througout a script for everytime I want an answer from a user.
Thanks
Inf
Now
Heres my question. Bourne shell script with the following
echo "Do you want something (y/n)?"
while true;do
read answer
if [ "$answer" = Y -o "$answer" = y ]
then
DO A COMMAND HERE
break
elif [ "$answer" = N -o "$answer" = n ]
then
echo "Skipping to the next step"
break
fi
done
Any suggestions on shortening this alot. I dont want to repeat it througout a script for everytime I want an answer from a user.
Thanks
Inf