shell 预定义变量

echo "上一次后台pid is $!"
echo "当前进程pid is $$"
echo "last command return code is :$?"
echo "bash file name is $0"
echo "all var is: $*"
echo "var number is : $# "

===========gold  line of out=========

上一次后台pid is
当前进程pid is 53971
last command return code is :0
bash file name is echo_var.sh
all var is: 1 44 test this
var number is : 4

 

获取脚本name和脚本目录:

basename   filepath 

dirname   filepath 

 

posted @ 2020-02-10 15:04  不带R的墨菲特  阅读(289)  评论(0编辑  收藏  举报