Michael K.
Michael K.

Reputation: 1788

Abort piping to grep on first match

Is it possible to pipe from an ongoing process into grep and return to prompt on first match?

docker compose logs -f | grep -m 1 foobar

So after the first match of "foobar" the pipe chain should abort without error and return to prompt.

Upvotes: 0

Views: 134

Answers (0)

Related Questions