-1
工作
我收到此错误:我的if语句不猛砸
[[: command not found
这里是我的代码:
#!/usr/bin/env bash
IS_PYSTACHE_INSTALLED=$(pip list --format=columns | grep "pystache ")
if [[ ! -z "${IS_PYSTACHE_INSTALLED}" ]]; then
echo " > Installing pystache"
pip install pystache
else
echo " > Pystache is already installed"
fi
我在做什么错?
你确定你的shell真的是Bash吗?可能它是别的,例如Dash。 – janos
如果您没有shebang并且正在以脚本的形式执行它(例如使用'./ script'而不是'bash script''''''''''''''''''''''''''''',支持'[['。 – chepner
我有shebang。我只是没有复制整个代码。没有理由。其余的工作。 – jnbdz