LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1382|回复: 6

$!是什么意思啊?

[复制链接]
发表于 2007-12-12 15:54:55 | 显示全部楼层 |阅读模式
另外$@和$*的区别怎么才能体现出来呢?谢谢
发表于 2007-12-12 17:37:00 | 显示全部楼层
关于定义问题,最好查手册。耐心点。
对于 @* 这两个特殊参量的区别,好在 bash(1) 里也说得相当清楚了。
回复 支持 反对

使用道具 举报

发表于 2007-12-12 21:47:03 | 显示全部楼层
$!  在后台运行的最后的工作的PID(进程ID)
$@与$*同义,但是每个参数都是一个独立的""引用字串,这就意味着参数被完整地传递,并没有被解释和扩展。
刚好在看SAMS-Linux_Shell_Scripting_With_Bash,粘上来给你参考
Although both $@ and $* refer to all the parameters, they differ when they are enclosed in double quotes. $* parameters are separated by the first character of the IFS variable, or by spaces if IFS is empty, or without anything when IFS is unset. $* treats the set of parameters as a single group.
$@, on the other hand, always separates the parameters by spaces and treats the parameters as individual items, even when they are enclosed in double quotes. $@ is often used to transfer the entire set of switches to another command (for example, ls $@).
回复 支持 反对

使用道具 举报

发表于 2007-12-13 08:01:03 | 显示全部楼层
回复 支持 反对

使用道具 举报

发表于 2007-12-13 16:17:24 | 显示全部楼层


那里都有你的身影。。。:cool:
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-12-15 21:41:49 | 显示全部楼层
谢谢各位,非常感谢
回复 支持 反对

使用道具 举报

发表于 2007-12-20 19:25:01 | 显示全部楼层
网中人士非常厉害的。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表