./ 和. /的区别

ARISYANG
./ 和. /的区别

我有一个命名为test.sh的shell:
...
./test2.sh
...
我的意思就是在这个test.sh的shell里调用test2.sh这个shell.

我在公司的其他shell里面看见在“.” 和"/"中间加一个空格“ ”,我不清楚这二者之间的区别,请大家帮忙。

7717060
. function
引用另一个文件内容
./执行另一个shell

saub
说的挺晕
test.sh test2.sh是脚本吧?执行者两个脚本的才叫shell,比如bash
你说在其他shell里面看见在“.” 和"/"中间加一个空格,能不能贴出来?

简单地说,.代表当前目录 /代表根目录,./也是当前目录,就好象C:/abc/bcd和C:/abc/bad/一样(bcd是个目录)

cuci
./就是在当前路径执行
. /相当于 source /

ARISYANG
谢谢,研究研究!!!!

jinl
[quote]原帖由 [i]cuci[/i] 于 2008-6-20 16:22 发表 [url=http://linux.chinaunix.net/bbs/redirect.php?goto=findpost&pid=6621906&ptid=1012195][img]http://linux.chinaunix.net/bbs/images/common/back.gif[/img][/url]
./就是在当前路径执行
. /相当于 source / [/quote]
严重同意,建议问shell相关问题前,先去shell版看看精华帖,把shell的一些命令搞清楚再问问题

sdu_lizhipeng
LZ去看看那shell十三问,有你想要的,赫赫

lasama
./在子shell中执行
. /在当前shell中执行

志国
貌似是:
./shellscript
. ./shellscript

[[i] 本帖最后由 志国 于 2008-6-21 00:09 编辑 [/i]]

寂寞烈火
[quote]原帖由 [i]lasama[/i] 于 2008-6-21 00:02 发表 [url=http://linux.chinaunix.net/bbs/redirect.php?goto=findpost&pid=6622448&ptid=1012195][img]http://linux.chinaunix.net/bbs/images/common/back.gif[/img][/url]
./在子shell中执行
. /在当前shell中执行 [/quote]
正解!~~~~~~~~~~