Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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.
command ... | tee /dev/tty | grep ...
How about:
output=$(commandThatProducesOutput) until echo "$output" | grep -m 1 "Done" do echo "$output" output=$(commandThatProducesOutput) done
Add a comment
echo "$output"
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
command ... | tee /dev/tty | grep ...should do what you want. See how-to-pipe-stdout-while-keeping-it-on-screen-and-not-to-a-output-file.