until commandThatProducesOutput | grep -m 1 "Done"
do
???
sleep 5
done
当这个脚本运行时,我想将commandThatProducesOutput产生的输出传递给屏幕,但似乎无法获得正确的语法。
答案 0 :(得分:1)
怎么样:
output=$(commandThatProducesOutput)
until echo "$output" | grep -m 1 "Done"
do
echo "$output"
output=$(commandThatProducesOutput)
done