From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: EB double-grep function for bash Date: Thu, 21 Jul 2016 18:21:44 +0200 Organization: Aioe.org NNTP Server Message-ID: <86oa5r3qsn.fsf@student.uu.se> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1469119000 14655 80.91.229.3 (21 Jul 2016 16:36:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jul 2016 16:36:40 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 21 18:36:39 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bQGxd-0000k0-Bw for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Jul 2016 18:36:33 +0200 Original-Received: from localhost ([::1]:41962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQGmu-0008Su-U4 for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Jul 2016 12:25:28 -0400 Original-Path: usenet.stanford.edu!goblin3!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 66 Original-NNTP-Posting-Host: EoOtCC1fCYcttx6jjhWUlA.user.gioia.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:FWulqVOJ03o7l7MDRMh6O5FTt9M= X-Notice: Filtered by postfilter v. 0.8.2 Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:218593 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110904 Archived-At: Tomas Nordin wrote: > Since the thread strayed away a little from > emacs already... Only superficially. The problem is how to find a particular Emacs tool. The assumption is that the user knows the conventional designation of the tool and that the same designation is used in Emacs. The answer what to do is as usual not a single answer but a toolbox of methods in itself, one of the tools proposed being greping the Emacs source. To do that we use the conventional shell tools like grep, but one could easily think of several others, e.g., awk, sed, even Perl. To those who didn't know, grep is not only an acronym-contraction, it was once a *command* in one of the early line editors, for "global regular expression print" - which makes sense! I think I read this in either: @book{quarter-century-of-unix, title = {A Quarter Century of UNIX}, author = {Peter Salus}, publisher = {Addison-Wesley}, year = 1994, ISBN = 0201547775, } or @book{sed-awk, title = {sed \& awk}, author = {Dale Dougherty; Arnold Robbins}, publisher = {O'Reilly}, year = 1997, edition = {2nd edition}, ISBN = {1-56592-225-5}, } In Emacs, there is `grep', `grep-find', and so on in /usr/share/emacs/24.4/lisp/progmodes/grep.el (or: /usr/share/emacs/24.4/lisp/progmodes/grep.el.gz) That code is - advanced :) > I made a little change on two > lines in this function to make it run with > bash. (I think the array subscript is a zsh > thing). Here's the lines: > > local files > files=${@:5:$#} Cool :) -- underground experts united .... http://user.it.uu.se/~embe8573 Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic - so far: 58 Blogomatic articles -