Unix 环境变量设置

2018-05-21  本文已影响0人  jeanroy

1. Environment Variables

2. Shell Variables

set or display shell variables:
type: set xxx
unset shell variables:
type: unset xxx
show all shell variables:
type: set | less

3. Using and setting variables

default file: ~/.login (C shell) or ~/.cshrc(TC shell)
~/.login: set conditions which will apply to the whole session and to perform actions that are relevant only at login.

~/.cshrc: set conditions and perform actions specific to the shell and to each invacation of it

recommand: set ENVIRONMENT variables in the .login file , and SHELL variables in the .cshrc file
warning: NEVER put commands that run graphical displays (e.g. a web browser) in your .cshrc or .login file

4. Setting shell variables in the .cshrc file

  1. edit ~/.cshrc file: set history = 200
  2. % source .cshrc
  3. % echo $history

5. Setting the path

上一篇 下一篇

猜你喜欢

热点阅读