Command-Line
-l 參數在 tcsh 中是什麼意思?
我正在執行一個 tcsh shell。
-l
我對 中的選項有疑問set -l
。當我查看 man
set
命令時,我看不到-l
參數。使用 tcsh shell 時,
-l
參數是什麼意思?在哪里以及如何找到此資訊?
你看錯地方了。這是來自
tcsh(1)
手冊頁:set set name ... set name=word ... set [-r] [-f|-l] name=(wordlist) ... (+) set name[index]=word ... set -r (+) set -r name ... (+) set -r name=word ... (+) The first form of the command prints the value of all shell variables. Variables which contain more than a single word print as a parenthesized word list. The second form sets name to the null string. The third form sets name to the single word. The fourth form sets name to the list of words in wordlist. In all cases the value is command and filename expanded. If -r is specified, the value is set read-only. If -f or -l are specified, set only unique words keeping their order. -f prefers the first occurrence of a word, and -l the last.
所以
set -f list=(foo bar baz foo)
將設置list
為(foo bar baz)
,但
set -l list=(foo bar baz foo)
將設置list
為(bar baz foo)
,並將
set list=(foo bar baz foo)
其設置為(foo bar baz foo
),保持重複。唯一的區別是它如何處理單詞列表中的重複項。此功能在 classic/real 中不存在
csh
,它現在是不受阻礙的開源本身,並且(如果我沒記錯的話)csh
許多系統上的預設設置。