我想使用 ag,就好像我将 grep 与 --line-buffered 一起使用。可能吗?如果不是,我还有什么其他选择来模仿这种行为?
我也想ag支持--line-buffered样式功能。
我已经针对Github repo 提出了PR #719ag来请求这个功能。
同时,我发现的最佳解决方案是ag使用stdbuf -oL.
# instead of grep
grep --line-buffered pattern
# use ag with a stdbuf wrapper
stdbuf -oL ag pattern