내부 변수 REPLY
[root@server100 shell]# read # ,read , $REPLY
mah
[root@server100 shell]# echo $REPLY
mah
[root@server100 shell]# read var
MAH
[root@server100 shell]# echo $var
MAH
용도 2: selection 구문 에서:
#!/bin/bash
echo "Pls choose your professional:"
select var in "worker" "doctor" "teacher"
do
echo "the \$REPLY is $REPLY"
echo "your professional is $var"
break
done
[root@server100 shell]# ./select1.sh
Pls choose your professional:
1) worker
2) doctor
3) teacher
#? 1
the $REPLY is 1
your professional is worker
본 고 는 "8176010" 블 로그 에서 나 왔 으 니 전재 를 사절 합 니 다!