So...

本區專門提供 Mac OS X 使用者交換使用心得

版主: ross_ttbryanchangdigdogchester

回覆文章
內容
發表人
vingtaine
基本會員
文章: 33
註冊時間: 05/01/2001 1:01 am

So...

#1 文章 vingtaine »

And when I try to run it in school(SunOS 5.8), I just type %a.out and it works, why, is that because the OS is SunOS?! So it has different command?

???
With my PB(OS X), it works only if I type % ./a.out
頭像
bryanchang
討論區管理員
文章: 7057
註冊時間: 04/19/2001 1:01 am
來自: The '60s
聯繫:

So...

#2 文章 bryanchang »

That is becuase the working directory (.) is not in your shell's path, this is not an overlook, but to make your system more fool proof.

[ 02-14-2002: 留言編輯者: 白萊恩 ]
頭像
bryanchang
討論區管理員
文章: 7057
註冊時間: 04/19/2001 1:01 am
來自: The '60s
聯繫:

So...

#3 文章 bryanchang »

舉例來說:

假設你在工作目錄中有一個叫做 ls 的執行檔,然後這個檔案其實是會把目錄中所有的檔案刪除。

在 Sun OS 下,因為 . 是在路徑裡,所以你這時後不小心打了 ls -l 的話,你的檔案就死光光了。

可是若是像 Mac OS X 不把 . 放在路徑裡的話,這種問題就不會出現,同時你要真的知道你在幹嘛的話,你只要輸入 ./ls 還是可以去執行在工作目錄裡的檔案的。

所以這個設定是用來避免使用者因不小心而犯下大錯。
vingtaine
基本會員
文章: 33
註冊時間: 05/01/2001 1:01 am

So...

#4 文章 vingtaine »

Y.原來如此.....謝了....
回覆文章