只是混淆了命令「ls *」的輸出。我在Ubuntu 11.10和Redhat Enterprise 6.3中都測試了腳本,得到了相同的結果。「ls *」的輸出不一致
殼牌登錄
$ uname -a
Linux 2.6.32-279.19.1.el6.x86_64 #1 SMP Sat Nov 24 14:35:28 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
$ echo $0
-bash
$ cd test
$ ls
$ ls * *<== at first, no file/directory under current work directory*
ls: cannot access *: No such file or directory
$ mkdir abc *<== create a new directory "abc"*
$ ls * *<== output of "ls *" is empty but directory "abc" has been created.*
$ mkdir abcd *<== create the second directory "abcd"*
$ ls * *<== at this point, all the directories("abc" and "abcd") are displayed.*
abc:
abcd:
任何人都可以解釋爲什麼後目錄 「ABC」 創建 「LS *」 的輸出是空的?謝謝。
證實你所說的,完全正確。謝謝。 – thinkhy