- 论坛徽章:
- 0
|
本帖最后由 Ex_ 于 2010-10-03 17:40 编辑
The test command is a Bash builtin which tests file types and compares strings. Therefore, in a Bash
script, test does not call the external /usr/bin/test binary, which is part of the sh-utils package.
Likewise, [ does not call /usr/bin/[, which is linked to /usr/bin/test.
我不确信我完全正确地理解这段话,所以请大家帮忙围观,各抒已见
我的观点
1.首先,test ,[ 这两个命令是内置命令是确定的。内置命令也就是随shell一起附带的命令。所以当启用shell启用时,内置命令是一起载入内存的(我觉得这点不一定,有可能交换在swap中)
2.那么,当调用test时,就直接运行,不用再从PATH路径里去找,我不明白的是:- 有什么情况我们是需要指明路径:/usr/bin/test的?
复制代码 3.[不用去调用/usr/bin/[。当然,[也是内置命令,所以不用去调用/usr/bin/[.我不明白的是:- 它是一个到/usr/bin/test 的链接是什么意思?我查了下/usr/bin/[,并没有指向test.
复制代码 |
|