2

In eshell, one of the nice things is commands like grep's output will be redirected to Emacs special buffers. However, if I do a grep on previous grep, e.g.:

grep "abc" *.el | grep -v "ghi"

that output only appears in standard output. I'm wondering if there is a way to direct that output to Emacs special buffer as well.

Thanks.

sudo
  • 647
  • 2
  • 7
  • 19

1 Answers1

3

(grep "grep abc *.el | grep -v ghi -") opens the resulting matches in a new widow, but next-error does not work with it though.

vpit3833
  • 7,817
  • 2
  • 25
  • 25
  • Is the "grep a typo? I tried `(grep grep "raise" *.py | grep -v "RF_Test")`, `(grep 'grep "raise" *.py | grep -v "RF_Test")`, `(grep "grep" "raise" *.py | grep -v "RF_Test")` none of them works – sudo Apr 20 '11 at 01:05
  • @sudo sorry, the typo was when I pasted from the question, I did not remove the " marks. Edited the answer. Using 'abc' and 'ghi' works, if quoting is needed. – vpit3833 Apr 20 '11 at 01:16
  • Ha, it's work now. Thanks. In order for it to really work well, I have to add -n : `(grep "grep -n abc *.el | grep -v ghi -")` – sudo Apr 20 '11 at 01:25