为什么这不起作用
if [[ screen -ls | grep -q "Hello" ]];
then
echo "Hello";
fi
它给出错误
-bash: unexpected token `|', conditional binary operator expected
-bash: syntax error near `-ls'
但这有效
if screen -ls | grep -q "Hello";
then
echo "Hello";
fi
不应该是相反的方式吗?我该如何修复双括号。