有什么方法可以同时使用 while 循环和 grep 吗?看我的例子:
while [[ !(grep -R -h "${text}" ${path}) ]];
do
...
done
Run Code Online (Sandbox Code Playgroud)
它说:
./test_script.sh: line 1: conditional binary operator expected
./test_script.sh: line 1: expected `)'
./test_script.sh: line 1: syntax error near `-R'
./test_script.sh: line 1: `while [[ !(grep -R -h "${text}" ${path}) ]];'
Run Code Online (Sandbox Code Playgroud)