reply.sh

来自「Shall高级编程」· Shell 代码 · 共 26 行

SH
26
字号
#!/bin/bash# reply.sh# REPLY is the default value for a 'read' command.echoecho -n "What is your favorite vegetable? "readecho "Your favorite vegetable is $REPLY."#  REPLY holds the value of last "read" if and only if#+ no variable supplied.echoecho -n "What is your favorite fruit? "read fruitecho "Your favorite fruit is $fruit."echo "but..."echo "Value of \$REPLY is still $REPLY."#  $REPLY is still set to its previous value because#+ the variable $fruit absorbed the new "read" value.echoexit 0

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?