Shell 脚本中让用户输入 yes
场景:让用户输入 yes 再执行下一步
read -p "Please type 'yes' to continue: " input
if [ "$input" != "yes" ]; then
echo "You did not enter 'yes'. Exit..."
exit 1
fi
场景:让用户输入 yes 再执行下一步
read -p "Please type 'yes' to continue: " input
if [ "$input" != "yes" ]; then
echo "You did not enter 'yes'. Exit..."
exit 1
fi