shell 脚本中$$,$#,$?分别代表的意思

Tag: Linux Shell 
Posted on 2020-07-22

$0 这个程式的执行名字

$n 这个程式的第n个参数值,n=1..9

$* 这个程式的所有参数,此选项参数可超过9个。

$# 这个程式的参数个数

$$ 这个程式的PID(脚本运行的当前进程ID号)

$! 执行上一个背景指令的PID(后台运行的最后一个进程的进程ID号)

$? 执行上一个指令的返回值 (显示最后命令的退出状态。0表示没有错误,其他任何值表明有错误)

$- 显示shell使用的当前选项,与set命令功能相同

$@ 跟$*类似,但是可以当作数组用

 评论
张三
orz
李四
orz orz
李小四
orz orz orz
张小三
orz orz orz orz
  搜索
  Tags
全部   Ubuntu   Linux   Python   Windows   Shell   转发   浏览器   js   KMS   循环   MySQL   字体   html   css   DNS   电源   多线程   反向代理   重定向   原创   WinSCP   随机   随机数   VSCode   venv   vbs   多进程   远程调试   字典   生活   激活   线程池   日志   数据库   网卡   截取字符   进度条   安装   进程池   领带   uuid   tc   IP   iostat   import   GitHub   dpkg   DHCP   curl   crx   CPU   cloud-init   Chrome   BBR   Apt   iptables   Kitsunebi   subprocess   SSH   SoftEther   Set   samba   pyflakes   pip   Office   Nginx   NextCloud   List   libreoffice   kvm   Adobe  
  功能
You can put anything you want inside of these side widgets. They are easy to use, and feature the new Bootstrap 4 card containers!