1
使用“ source file.sh”,“ ./ file.sh”,“ sh file.sh”,“。”执行Shell脚本之间有什么区别。./file.sh”?
看一下代码: #!/bin/bash read -p "Eneter 1 for UID and 2 for LOGNAME" choice if [ $choice -eq 1 ] then read -p "Enter UID: " uid logname=`cat /etc/passwd | grep $uid | cut -f1 -d:` else read -p "Enter Logname: " logname fi not=`ps -au$logname | grep -c bash` echo …