From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: al.coyote@gmail.com Newsgroups: gmane.emacs.help Subject: Re: How to avoid /dev/null at the end of grep-command Date: 3 Mar 2007 00:09:46 -0800 Organization: http://groups.google.com Message-ID: <1172909386.423112.219580@z35g2000cwz.googlegroups.com> References: <1172827235.116923.127160@31g2000cwt.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1172911245 20440 80.91.229.12 (3 Mar 2007 08:40:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 3 Mar 2007 08:40:45 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 03 09:40:38 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HNPnA-0006lQ-32 for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Mar 2007 09:40:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HNPn9-0008Av-FC for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Mar 2007 03:40:35 -0500 Original-Path: shelby.stanford.edu!newshub.stanford.edu!postnews.google.com!z35g2000cwz.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: 81.56.169.20 Original-X-Trace: posting.google.com 1172909395 6494 127.0.0.1 (3 Mar 2007 08:09:55 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 3 Mar 2007 08:09:55 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20061205 (Debian-1.8.0.9-1) Galeon/2.0.2 (Debian package 2.0.2-4),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: z35g2000cwz.googlegroups.com; posting-host=81.56.169.20; posting-account=H89-iA0AAAAoUALiCbsFWJeFeaCMOlzg Original-Xref: shelby.stanford.edu gnu.emacs.help:146009 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:41613 Archived-At: Hello Eli, On 2 mar, 14:49, Eli Zaretskii wrote: > > From: al.coy...@gmail.com > > Date: 2 Mar 2007 01:20:35 -0800 > > > Any solution to avoid the /dev/null, without modifying compile.el ? > > I'm guessing that this is Emacs 21.x; if not, holler. (I shouldn't be > guessing, btw: please always state your Emacs version and the OS.) > > One way to work around this is to write a wrapper command that binds > null-device to nil and then invokes the original `grep' command. You > can put this command in your .emacs. I'm using emacs 21 on linux, but as this feature comes from compile.el the behaviour should be the same on most architectures. This behaviour is very old, maybe version 20 and even 19 did have it (sorry I don't have these versions handy). Thanks for your suggestion, I have found another one. Just end your complex command with cat -, this command will do nothing except protect from the /dev/null So M-x grep with grep -n -A2 printf * | grep '\\n' | sed -e s/-/:/g | cat - will be transformed by emacs into grep -n -A2 printf * | grep '\\n' | sed -e s/-/:/g | cat - /dev/null which will do the job. Al