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

前端之家收集整理的这篇文章主要介绍了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.f2er.com/bash/391428.html

猜你在找的Bash相关文章