微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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的第一个参数

原文地址:https://www.jb51.cc/bash/391428.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐