Chinaunix首页 | 论坛 | 博客
  • 博客访问: 146960
  • 博文数量: 52
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 490
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-05 12:05
文章分类

全部博文(52)

文章存档

2013年(1)

2010年(3)

2009年(6)

2008年(25)

2007年(17)

我的朋友

分类:

2008-09-23 16:53:46

eval: execute all shell replacement before issue the command.

ivan@Maintenance_Center:~$ set a b c d
ivan@Maintenance_Center:~$ eval echo The last argument is \$$#
The last argument is d
ivan@Maintenance_Center:~$ echo The last argument is \$$#     
The last argument is $4
ivan@Maintenance_Center:~$


exec: open or close the standard input or output.

#!/bin/bash
exec < /tmp/file #open the /tmp/file
while read line;do
    echo ${line}
done

#will print file /tmp/file

if you want read from terminal after you close standard input you should specify the optional input

read answer < /dev/tty
阅读(1402) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~