Unix shell 中的特殊变量?

编程入门 行业动态 更新时间:2024-10-23 21:27:54
本文介绍了Unix shell 中的特殊变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-28 17:10:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1176927.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:变量   Unix   shell

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!