0
until commandThatProducesOutput | grep -m 1 "Done"
do
        ???
        sleep 5
done

While this script is running, I'd like to pipe the output that commandThatProducesOutput produces to the screen but can't seem to get the correct syntax.

2

1 Answer 1

1

How about:

output=$(commandThatProducesOutput)

until echo "$output" | grep -m 1 "Done"
do
    echo "$output"
    output=$(commandThatProducesOutput)
done
Sign up to request clarification or add additional context in comments.

1 Comment

echo "$output", please.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.