运行shell脚本时报错“[[ : not found“解决方法
运行shell脚本时报错"[[ : not found"解决方法
问题描述
在运行shell脚本时报错,命令为:
sh test.sh
报错如图:
脚本代码如下:
#!/bin/bash
# file:test.sh
# author:13
# date:2017-07-20
set -e
STR1="test string"
STR2="ter"
echo "STR1:"$STR1
echo "STR2:"$STR2
if [[ "$STR1" =~ "$STR2" ]];th
转载
2020-11-13 12:02:21 ·
1188 阅读 ·
0 评论