shell中特殊变量
- $# 传递到脚本的参数个数
- $$ 脚本运行的当前进程PID
- $! 最后一个运行的后台进程PID
- $- 当前Shell选项
-
#!/bin/sh echo "Num of arguments: $#" echo "Current PID: $$" echo "The last deforegroud PID: $!" echo "The current shell options: $-" echo "Current PID: $$"
-
#!/bin/sh echo "Num of arguments: $#" echo "Current PID: $$" sleep 10 & echo "The last deforegroud PID: $!" echo "The current shell options: $-" echo "Current PID: $$"