- 論壇徽章:
- 0
|
回復 xiaopan3322
謝謝,第一種方法 哈哈
go2moon2010 發(fā)表于 2011-07-31 22:56 ![]()
剛剛討論了一下,比較保險的方法是用第二種……
第一種有可能失敗的,原因是因為不同的版本,有可能對 -- 識別不了,
實際上,--的作用和 ./的作用相同:都是為了讓 - 這個dash符號不被解釋成命令選項:
Many meta-characters such as semicolons, spaces, backslashes, dollar signs, question marks, and asterisks are characters that are interpreted under Unix as commands.
- or -- interpreted as an option passed to the command.
The -- delimit the option list. Later arguments, if any, are treated a operands even if they begin with - or --. This applies to all commands such as rm, cp, mv, ls, ln and so on
另外,--并不是所有的命令都能識別的,比如echo就不能…… |
|