LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 593|回复: 4

有没有详细的变量表?[附:ksh专用变量列表]

[复制链接]
发表于 2004-7-9 21:05:12 | 显示全部楼层 |阅读模式
比如
$HOME就是用户目录
还有$PATH,$PWD等
有没有这种变量比较全的列表?
发表于 2004-7-9 21:24:42 | 显示全部楼层
#set
发表于 2004-7-9 23:52:08 | 显示全部楼层
man bash 也许得到的信息更详细 ;)
 楼主| 发表于 2004-7-11 12:24:30 | 显示全部楼层
谢谢了~

set可以得到当前的变量值
man bash可以得到许多更详细的信息

非常有用:)
发表于 2004-7-11 19:54:26 | 显示全部楼层

附录

一份kornshell专用变量列表(与bash基本类似,以各自系统上的shell的manpage为准)
  1. KornShell Reserved variables :

  2.   +-----------+-----------------------------------+-------------------+------+
  3.   | Variable  | What this variable holds          | Default           | Who  |
  4.   |           |                                   |                   | sets |
  5.   +-----------+-----------------------------------+-------------------+------+
  6.   | CDPATH    | directories that cd searches      | none              | U    |
  7.   | COLUMNS   | terminal width                    | 80                | SA   |
  8.   | EDITOR    | pathname of command line editor   | /bin/ed           | U,SA |
  9.   | ENV       | pathname of startup script        | none              | U,SA |
  10.   | ERRNO     | error number of most recently     | none              | KSH  |
  11.   |           | failed system call                |                   |      |
  12.   | FCEDIT    | pathname of history file editor   | /bin/ed           | U,SA |
  13.   | FPATH     | path of autoload functions        | none              | U    |
  14.   | HISTFILE  | pathname of history file          | $HOME/.sh_history | U,SA |
  15.   | HISTFILE  | nb of command in history file     | 128               | U,SA |
  16.   | HOME      | login directory                   | none              | SA   |
  17.   | IFS       | set of token delimiters           | white space       | U    |
  18.   | LINENO    | current line number within        | none              | KSH  |
  19.   |           | script or function                |                   |      |
  20.   | LINES     | terminal height                   | 24                | SA   |
  21.   | LOGNAME   | user name                         | none              | SA   |
  22.   | MAIL      | patname of master mail file       | none              | SA   |
  23.   | MAILCHECK | mail checking frequency           | 600 seconds       | U,SA |
  24.   | MAILPATH  | pathnames of master mail files    | none              | SA   |
  25.   | OLDPWD    | previous current directory        | none              | KSH  |
  26.   | OPTARG    | name of argument to a switch      | none              | KSH  |
  27.   | OPTIND    | option's ordinal position on      | none              | KSH  |
  28.   |           | command line                      |                   |      |
  29.   | PATH      | command search directories        | /bin:/usr/bin     | U,SA |
  30.   | PPID      | PID of parent                     | none              | KSH  |
  31.   | PS1       | command line prompt               | $                 | U    |
  32.   | PS2       | prompt for commands that          | >                 | U    |
  33.   |           | extends more than 1 line          |                   |      |
  34.   | PS3       | prompt of 'select' statements     | #?                | U    |
  35.   | PS4       | debug mode prompt                 | +                 | U    |
  36.   | PWD       | current directory                 | none              | U    |
  37.   | RANDOM    | random integer                    | none              | KSH  |
  38.   | REPLY     | input repository                  | none              | KSH  |
  39.   | SECONDS   | nb of seconds since KornShell     | none              | KSH  |
  40.   |           | was invoked                       |                   |      |
  41.   | SHELL     | executed shell (sh, csh, ksh)     | none              | SA   |
  42.   | TERM      | type of terminal you're using     | none              | SA   |
  43.   | TMOUT     | turn off (timeout) an unused      | 0 (unlimited)     | KSH  |
  44.   |           | KornShell                         |                   |      |
  45.   | VISUAL    | command line editor               | /bin/ed           | U,SA |
  46.   | $         | PID of current process            | none              | KSH  |
  47.   | !         | PID of the background process     | none              | KSH  |
  48.   | ?         | last command exit status          | none              | KSH  |
  49.   | _         | miscellaneous data                | none              | KSH  |
  50.   +-----------+-----------------------------------+-------------------+------+
  51.   | Variable  | What this variable holds          | Default           | Who  |
  52.   |           |                                   |                   | sets |
  53.   +-----------+-----------------------------------+-------------------+------+
  54.     Where U  : User sets this variable
  55.           SA : system administrator
  56.           KSH: KornShell
复制代码

ps:相信大家都有stardict这个东东,英文很简单,stardict一下就明白了,呵呵
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表