有點奇怪的bash script 參數問題 - Linux

By Mia
at 2015-10-11T21:06
at 2015-10-11T21:06
Table of Contents
承上,
感謝CP64的解說,所以說萬用字元*會在有參數的script執行中轉譯2次?
接下來就跟萬用字元有關的問題,如下圖:
ls c* 就是列出 c開頭的檔案,所以得到 cccc. command.sss
ls c\* 因為*被 \ escape掉了,所以列出叫 c* 的檔案,但是沒有叫 c* 的檔案,
所以顯示 c*: No such file or directory
find . -name c\* 應該也要顯示 No such file or directory ?
為何可以找到./cccc.
./command.sss
http://i65ynb.2fh.co/pics/wildc.jpg
--
感謝CP64的解說,所以說萬用字元*會在有參數的script執行中轉譯2次?
接下來就跟萬用字元有關的問題,如下圖:
ls c* 就是列出 c開頭的檔案,所以得到 cccc. command.sss
ls c\* 因為*被 \ escape掉了,所以列出叫 c* 的檔案,但是沒有叫 c* 的檔案,
所以顯示 c*: No such file or directory
find . -name c\* 應該也要顯示 No such file or directory ?
為何可以找到./cccc.
./command.sss
http://i65ynb.2fh.co/pics/wildc.jpg

--
Tags:
Linux
All Comments

By Catherine
at 2015-10-13T13:00
at 2015-10-13T13:00

By Jake
at 2015-10-13T22:39
at 2015-10-13T22:39

By Margaret
at 2015-10-18T08:05
at 2015-10-18T08:05

By Freda
at 2015-10-21T09:41
at 2015-10-21T09:41

By Olga
at 2015-10-22T11:59
at 2015-10-22T11:59

By Andy
at 2015-10-24T01:12
at 2015-10-24T01:12

By Puput
at 2015-10-26T04:30
at 2015-10-26T04:30

By Lily
at 2015-10-29T23:57
at 2015-10-29T23:57

By Isla
at 2015-10-30T15:58
at 2015-10-30T15:58

By Doris
at 2015-11-03T23:27
at 2015-11-03T23:27

By Susan
at 2015-11-08T17:03
at 2015-11-08T17:03

By Hazel
at 2015-11-13T04:17
at 2015-11-13T04:17

By Cara
at 2015-11-16T03:37
at 2015-11-16T03:37

By Christine
at 2015-11-16T12:39
at 2015-11-16T12:39

By Kelly
at 2015-11-20T23:41
at 2015-11-20T23:41

By Linda
at 2015-11-22T18:54
at 2015-11-22T18:54

By Ophelia
at 2015-11-23T13:13
at 2015-11-23T13:13
Related Posts
openvpn的static key和tls-auth一樣嗎?

By Harry
at 2015-10-11T18:39
at 2015-10-11T18:39
安裝hime 注音後,為何沒辦法輸入中文?

By Elvira
at 2015-10-11T14:41
at 2015-10-11T14:41
Windows8 + Centos7.1==>開機選項不見win8

By Yuri
at 2015-10-11T02:12
at 2015-10-11T02:12
萌 快樂

By Lauren
at 2015-10-10T12:01
at 2015-10-10T12:01
如何刪除網路芳鄰紀錄

By Jacob
at 2015-10-09T20:17
at 2015-10-09T20:17