shell脚本的if 命令cannot found?
来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:综合作业 时间:2024/04/30 00:03:29
shell脚本的if 命令cannot found?
我编写了一个非常简单的脚本
/bin/bash
a=1
b=2
if [ "$a" -ne "$b"]
then echo "$a is not the same as $b"
fi
可是在终端运行结果如下:
[root@localhost Desktop]# ./bash4.sh
./bash4.sh:line 7:if[ 1 -ne 2 ]:command not found
./bash4.sh:line 8:syntax error near unexpected token `then'
./bash4.sh:line 8:`then'
[root@localhost Desktop]#
我编写了一个非常简单的脚本
/bin/bash
a=1
b=2
if [ "$a" -ne "$b"]
then echo "$a is not the same as $b"
fi
可是在终端运行结果如下:
[root@localhost Desktop]# ./bash4.sh
./bash4.sh:line 7:if[ 1 -ne 2 ]:command not found
./bash4.sh:line 8:syntax error near unexpected token `then'
./bash4.sh:line 8:`then'
[root@localhost Desktop]#
#!/bin/bash
a=1
b=2
if [ "$a" -ne "$b"]; then
echo "$a is not the same as $b"
fi
我习惯这么写 ,试试看
a=1
b=2
if [ "$a" -ne "$b"]; then
echo "$a is not the same as $b"
fi
我习惯这么写 ,试试看
shell脚本的if 命令cannot found?
shell脚本if [ $1
shell脚本中>/dev/null的含义
shell脚本中 if 判断时候-s是什么意思
shell脚本中的$
shell 脚本中$$,$#,
在shell(#!/bin/sh)脚本中怎么使用expect命令,需要添加什么环境变量吗,
谁帮忙解释这个shell脚本的含义::(){:|:&};:
shell脚本中单引号和双引号的区别
linux下shell脚本命令 这个命令要实现三个功能.一能备份文件夹里的内容.二把备份文件压缩并存心到指定文件夹.三用
shell脚本 /bin/bash if [[ $1=="D" ]]; then echo D else echo M
在shell脚本中有个语句是if [ -d $1"/"$file ],其中 $1"/"$file是什么意思