如何在shell脚本中提示用户输入数据,并将数据传入到脚本中? 2015/07/16 14702 #!/bin/bash # This example shows how to prompt for user's input. echo -n "Are you in prod environment?" read ANS case $ANS in y|Y|yes|Yes) ENV='prod' ;; n|N|no|No) #exit 0 ENV='uat' ;; esac echo "I am in $ENV environment."