shell脚本读取用户输入并与之交互
举个栗子:
#! /bin/bash echo -e "你真要想要执行此操作吗,yes or no?" read Confirm case $Confirm in y|Y|yes|Yes) echo "做你想做的事情吧" ;; *) echo "操作终止了!" esac
举个栗子:
#! /bin/bash echo -e "你真要想要执行此操作吗,yes or no?" read Confirm case $Confirm in y|Y|yes|Yes) echo "做你想做的事情吧" ;; *) echo "操作终止了!" esac