Gabor Marton
Gabor Marton

Reputation: 2099

What is ag's (silver searcher) analogous option to grep's --line-buffered?

I'd like to use ag as if I would use grep with --line-buffered. Is it possible? If not what other options do I have to mimic such behaviour?

Upvotes: 3

Views: 759

Answers (1)

fallwith
fallwith

Reputation: 31

I would like to have ag support --line-buffered style functionality as well.

I have raised PR #719 against the ag Github repo to request this functionality.

In the meantime, the best solution I've found is to wrap ag with stdbuf -oL.

# instead of grep
grep --line-buffered pattern

# use ag with a stdbuf wrapper
stdbuf -oL ag pattern

Upvotes: 3

Related Questions