网站介绍:这里是因为if的默认输出为正常时就[ -z $com ]没有问题,当输出错误就少了[],加上就没有问题了脚本#!/bin/bashwhile :do read -p "请输入要执行的命令:" com if [ -z $com ];then exit fi $com &> /dev/null if [ $? == 0 ];then echo "执行的命令是 $com" echo "命令执行成._shell mkdir no such file or directory
- 链接地址:https://blog.csdn.net/kali_yao/article/details/123962760
- 链接标题:shell执行if报错(No such file or directory)_shell mkdir no such file or directory_kali_yao的博客-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:3613
- 网站标签:shell mkdir no such file or directory