问题描述
限时送ChatGPT账号..我需要一份关于 unix shell 特殊变量(csh、ksh 和 bash)的良好参考.
I need a good reference on unix shell special variables (csh, ksh and bash).
例如$1
、$*
、$#
等
推荐答案
这里:http://sillydog/unix/scrpt/scrpt2.2.2.php
$1 - $9 这些变量是位置参数.
$1 - $9 these variables are the positional parameters.
$0 命令的名称当前正在执行.
$0 the name of the command currently being executed.
$#位置的数量对此的论据调用 shell.
$# the number of positional arguments given to this invocation of the shell.
$?的退出状态最后执行的命令是以十进制字符串形式给出.当一个命令成功完成,返回退出状态0(零),否则返回非零退出状态.
$? the exit status of the last command executed is given as a decimal string. When a command completes successfully, it returns the exit status of 0 (zero), otherwise it returns a non-zero exit status.
$$ 进程号这个外壳 - 有用的包括在文件名中,使它们独一无二.
$$ the process number of this shell - useful for including in filenames, to make them unique.
$!进程ID最后运行的命令背景.
$! the process id of the last command run in the background.
$- 当前选项提供给这个调用外壳.
$- the current options supplied to this invocation of the shell.
$* 包含所有的字符串的论据壳,1 美元起.
$* a string containing all the arguments to the shell, starting at $1.
$@ 同上,除了引用时.
$@ same as above, except when quoted.
更多资源:
http://linuxshellaccount.blogspot/2008/04/shell-special-variables-in-bash.htmlhttp://www.tutorialspoint/unix/unix-special-变量.htm这篇关于Unix shell 中的特殊变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论