Declare
来自 ChinaUnix Wiki
Linux命令:declare
功能说明:声明 shell 变量。
语 法:declare [+/-][rxi][变量名称=设置值] 或 declare -f
补充说明:declare为shell指令,在第一种语法中可用来声明变量并设置变量的属性([rix]即为变量的属性),在第二种语法中可用来显示shell函数。若不加上任何参数,则会显示全部的shell变量与函数(与执行set指令的效果相同)。
参 数: +/- "-"可用来指定变量的属性,"+"则是取消变量所设的属性。 -f 仅显示函数。 r 将变量设置为只读。 x 指定的变量会成为环境变量,可供shell以外的程序来使用。 i [设置值]可以是数值,字符串或运算式。
英文版本,欢迎翻译:
NAME bash, :, ., alias, bg, bind, break, builtin, case, cd, command, continue, declare, dirs, disown, echo, enable, eval, exec, exit, export, fc, fg, for, getopts, hash, help, history, if, jobs, kill, let, local, logout, popd, pushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test, times, trap, type, typeset, ulimit, umask, unalias, unset, until, wait, while - bash built-in commands, see bash(1)
BASH BUILTIN COMMANDS SEE ALSO bash(1), sh(1)
GNU 1996 Mar 20 1
