Re: 關於tcsh改shell variable
※ 引述《ben@kkcity.com.tw (我是ben)》之銘言:
: ※ 引述《hangchen.bbs@binary.csie.ncu.edu.tw (hang)》之銘言:
: > 在tcsh中,要對shell variables或是Env. vari. 做更改的話,
: > 要怎麼做呢?
: > 看過tcsh的manpage, 似乎找不到對於更改這兩種variables 的用法的詳細規範…
: > 要怎麼辦呢?
: setenv 嗎?
不好意思,沒有把manpage看完…
在PREFERENCE下有:
....
....
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. The fifth form sets the index'th component of name to
word; this component must already exist. The sixth form lists
only the names of all shell variables that are read-only. The
seventh form makes name read-only, whether or not it has a
value. The second form sets name to the null string. The
eighth form is the same as the third form, but make name read-
only at the same time.
These arguments can be repeated to set and/or make read-only
multiple variables in a single set command. Note, however,
that variable expansion happens for all arguments before any
setting occurs. Note also that `=' can be adjacent to both
name and word or separated from both by whitespace, but cannot
be adjacent to only one or the other. See also the unset
builtin command.
setenv [name [value]]
Without arguments, prints the names and values of all environ-
ment variables. Given name, sets the environment variable name
to value or, without value, to the null string.
只是不知文中所提variable expansion是所意?
...
...
--
〒作者:hangchen 來自:140.115.56.58
◎二進位的世界【140.115.50.50‧binary.csie.ncu.edu.tw】
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 3 篇):
FreeBSD 近期熱門文章
PTT數位生活區 即時熱門文章
6
14