LinuxSir.cn,穿越时空的Linuxsir!

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

请教!关于LDD3中example!

[复制链接]
发表于 2006-12-31 12:29:01 | 显示全部楼层 |阅读模式
偶在看LDD3中第3章的scull_load时,发现点问题搞不明白.还请高手赐教啊!
源代码在书上P51页

问题1
/sbin/insmod .$module.ko $* || exit 1

其中的$*代表的是什么呢?

注释是这样说的:使用传入到该脚本的所有参数调用insmod.

不过$*是怎么和这些参数联系到一起的呢?

是不是可以说传如脚本的参数都可以用$1,$2...来表示呢?

谢谢了!
发表于 2006-12-31 13:14:48 | 显示全部楼层
命令行参数
下面这段拷贝自man  bash
   Special Parameters
       The shell treats several parameters specially.  These parameters may only be referenced; assignment to them
       is not allowed.
       *      Expands  to  the  positional parameters, starting from one.  When the expansion occurs within double
              quotes, it expands to a single word with the value of each parameter separated by the first  charac-
              ter  of  the IFS special variable.  That is, "$*" is equivalent to "$1c$2c...", where c is the first
              character of the value of the IFS variable.  If IFS is unset, the parameters are separated  by  spa-
              ces.  If IFS is null, the parameters are joined without intervening separators.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-12-31 13:17:16 | 显示全部楼层
多写斑竹赐教,我好好看看去!

先谢过了!
回复 支持 反对

使用道具 举报

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

本版积分规则

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