Shell变量$#,$@,$0,$1,$2

The Linux Documentation Project (LDP) is working on developing good,reliable documentation for the Linux operating system. The overall goal of the LDP is to collaborate in taking care of all of the issues of Linux documentation,ranging from online documentation (man pages,HTML,and so on) to printed manuals covering topics such as installing,using,and running Linux. Here is the Linux Documentation Project Manifesto and copyright License for LDP works.

http://www.tldp.org/LDP/abs/abs-guide.pdf

  • $$

    Shell本身的PID(ProcessID)

  • $!

    Shell最后运行的后台Process的PID

  • $?

    最后运行的命令的结束代码(返回值)

  • $*

    所有参数列表,字串形式

  • $@

    所有参数列表,数组形式

  • $#

    添加到Shell的参数个数

  • $0

    Shell本身的文件

  • $1

    添加到Shell的第一个参数

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...