2008年(91)
分类:
2008-03-25 23:13:24
read使用
read -a arryname ---读入为数组
read -p prompt ----输出提示,并把提示后的输入存到REPLY内建变量中
[test@szbirdora 1]$ read -p "Enter your name:"
Enter your name:jack
[test@szbirdora 1]$ echo $REPLY
jack
[test@szbirdora 1]$ read -a name
jack tom susan
[test@szbirdora 1]$ echo ${name[2]}
susan
[test@szbirdora 1]$ echo ${name[0]}
jack