这是我的 bash 文件
#!/bin/sh
ENV=DEV
echo "env: $ENV"
if [[ "$ENV" == DEV* ]]; then
RUNTIME_CLASSPATH=$(cat ../build/dev.classpath)
echo "cp: $RUNTIME_CLASSPATH"
fi
echo "done"
这是终端输出:
~proj/bin$ ./test.sh
env: DEV
./test.sh: 7: [[: not found
done
我不明白出了什么问题。还有其他方法可以进行字符串比较吗?