看板FreeBSD
标 题Re: 关於tcsh改shell variable
发信站中央资工二进位的世界 (Sun Sep 12 21:15:41 2004)
转信站ptt!ctu-reader!ctu-peer!Spring!news.nctu!news.ntu!news.mcu!news.csie.m
※ 引述《[email protected] (我是ben)》之铭言:
: ※ 引述《[email protected] (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】