在Bash中,似乎有几个变量具有特殊的,一致意义的值.例如,
./myprogram &; echo $!
Run Code Online (Sandbox Code Playgroud)
将返回后台进程的PID myprogram.我知道其他人,比如$?我认为是目前的TTY.还有其他人吗?
我有一个脚本:
login {
# checking parameters -> if not ok print error and exit script
if [ $# -lt 2 ] || [ $1 == '' ] || [ $2 == '' ]; then
echo "Please check the needed options (username and password)"
echo ""
echo "For further Information see Section 13"
echo ""
echo "Press any key to exit"
read
exit
fi
} # /login
Run Code Online (Sandbox Code Playgroud)
但我真的不知道$#第三行的意思是什么.