Chinaunix首页 | 论坛 | 博客
  • 博客访问: 244432
  • 博文数量: 91
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 1100
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-15 14:35
文章分类

全部博文(91)

文章存档

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

阅读(1230) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~