特殊Bash变量

字符定义
$* 展开为位置参数,从1开始。当扩展发生在双引号时,它展开成一个单独的词,每个参数的值由 IFS 特殊变量的第一个字符分隔。
$@ 展开为位置参数,从1开始。当在双引号里展开时,每个参数展开成独立的词。
$# 把位置参数展开为十进制数字。
$? 展开成最近执行的前台管道程序的退出状态。
$- 一个连字符展开为当前选项标志 内部命令集 或者那些shell自己的集(如-i)。A hyphen expands to the current option flags as specified upon invocation, by the set built-in command, or those set by the shell itself (such as the -i ).
$$ 展开成shell的进程ID。
$! 展开成最近在后台(异步)执行的命令的进程ID。
$0 展开成shell或者shell脚本名。
$_ 下 划线变量在shell启动时设置,包含shell的绝对文件名或者作为参数列表被执行的脚本。随后,它展开为前一个命令扩展后的最后一个参数。它同样设置 为每个执行程序的全路径,放在那个命令的输出环境中。当检查邮件时,这个参数保存邮件文件的名字。The underscore variable is set at shell startup and contains the absolute file name of the shell or script being executed as passed in the argument list. Subsequently, it expands to the last argument to the previous command, after expansion. It is also set to the full pathname of each command executed and placed in the environment exported to that command.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值