error="Error contacting service. It is probably not running.fg"
result=$(echo$error | grep "Error")
if [ "$result" != "" ];thenecho"hadoop-master zookeeper启动异常,退出执行"fi
键盘操作
read -p "Please enter your name: " name
echo"Hello $name."ifread -t 5 -p "Please enter your name: " name
thenecho"Hello $name."elseechoecho"Sorry, too slow"fi
-t 55秒超时
read-s -p "Enter your password: " passwd
echoecho"Is your password really $passwd?"-s 隐藏