Linux 在Bash中使用shutdown命令时出错
现在运行脚本Linux 在Bash中使用shutdown命令时出错,linux,bash,Linux,Bash,现在运行脚本 read -p 'Want to use the timer (y/n) ? ' jwb2 if [[ $jwb2 =~ ^[Yy]$ ]]; then echo -n "Now Days " date +"%A and hour %T" read -p 'How many hours [24hrs] :' jwb3 echo Process the command sudo bash -c "
read -p 'Want to use the timer (y/n) ? ' jwb2
if [[ $jwb2 =~ ^[Yy]$ ]]; then
echo -n "Now Days "
date +"%A and hour %T"
read -p 'How many hours [24hrs] :' jwb3
echo Process the command
sudo bash -c "Shutdown -h $jwb3"
fi
bash:Shutdown:未找到命令
为什么会出现此错误?使用
shutdown
而不是shutdown
仍然保持相同的显示方式whereis-b shutdown
使用shutdown
命令的完整路径作为/sbin/shutdown-h$jwb3
me@linux:$./main.sh
Want to use the timer (y/n) ? y
Now Days Thursday and hour 16:09:49
How many hours [24hrs] :18:00
Process the command