From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5833 invoked by alias); 10 Mar 2018 03:51:58 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23228 Received: (qmail 19830 invoked by uid 1010); 10 Mar 2018 03:51:58 -0000 X-Qmail-Scanner-Diagnostics: from mta02.eastlink.ca by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(24.224.136.13):SA:0(-1.9/5.0):. Processed in 8.679644 secs); 10 Mar 2018 03:51:58 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: rayandrews@eastlink.ca X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset=utf-8; format=flowed X-Authority-Analysis: v=2.3 cv=dfKuI0fe c=1 sm=1 tr=0 a=RnRVsdTsRxS/hkU0yKjOWA==:117 a=RnRVsdTsRxS/hkU0yKjOWA==:17 a=IkcTkHD0fZMA:10 a=Ija9txHfAtdvP7Us6XUA:9 a=QEXdDO2ut3YA:10 X-EL-IP-NOAUTH: 24.207.101.9 Subject: Re: unmatched ' To: zsh-users@zsh.org References: <2dcec644-7acb-5916-2858-2301206f1da8@eastlink.ca> <18dac66c-f348-8123-c051-4deb3dd21294@eastlink.ca> <20180310032041.GF16478@pug.qqx.org> From: Ray Andrews Message-id: Date: Fri, 9 Mar 2018 19:51:44 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 In-reply-to: <20180310032041.GF16478@pug.qqx.org> Content-language: en-CA On 09/03/18 07:20 PM, Aaron Schrab wrote: > > No, that file is not included in any Debian package: So I've since discovered.  God knows where it came from, it's nothing of mine, that's for sure.  Apologies to Debian for the suggestion.  I've since killed it. > > > > Perhaps something like the following? This doesn't include the doing > the find(1), instead it's designed to get the text to search on > STDIN.  It also doesn't use the $wwild or $ccase variables, which I > didn't see defined anywhere. But that would be easy to add. > > No use of eval here. Besides being safer, that also tends to be more > readable; although the use of recursion here cuts down on that > improvement. > > Despite having zsh on the #! line, this would work with bash as well. > > #!/bin/zsh -u > # Multi-color grep > > __mcgrep() { >  local color=$1; shift >  local pattern="$1"; shift > >  if [[ $# = 0 ]]; then >    # No more patterns, just pass through the input >    cat >  else >    __mcgrep $((color + 1)) "$@" >  fi | >    GREP_COLOR="01;$color" grep --color=always "$pattern" > } > > # Start with yellow, then blue, magenta, cyan. > __mcgrep 33 "$@" > Thanks, that's interesting, I'll experiment with it tomorrow.