From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8118 invoked from network); 22 Mar 2001 22:53:47 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 Mar 2001 22:53:47 -0000 Received: (qmail 20001 invoked by alias); 22 Mar 2001 22:53:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13717 Received: (qmail 19989 invoked from network); 22 Mar 2001 22:53:41 -0000 Sender: opk Message-ID: <3ABA73A5.36498F25@u.genie.co.uk> Date: Thu, 22 Mar 2001 21:50:29 +0000 From: Oliver Kiddle X-Mailer: Mozilla 4.73 [en] (X11; I; Linux 2.2.18 i586) X-Accept-Language: en MIME-Version: 1.0 To: Zsh workers Subject: Re: Moving completion functions References: <3ABA72A9.EB9C68FC@u.genie.co.uk> Content-Type: multipart/mixed; boundary="------------C329455EB72709AD61FE5480" This is a multi-part message in MIME format. --------------C329455EB72709AD61FE5480 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I wrote: > The other thing which might be worth doing is looking through any other > functions any of us have. From these we may find some suitable for the > I've attached two of mine: hgrep is like grep but highlights Of course, it would help if I actually remembered to attach them. They should be on this e-mail. Oliver --------------C329455EB72709AD61FE5480 Content-Type: text/plain; charset=us-ascii; name="hgrep" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hgrep" # hgrep - highlight grep if (( ! $# )); then echo "Usage: $0:t [-e pattern...] [file...]" >&2 return 1 fi local -a regex local htext=`echotc so` ntext=`echotc se` while [[ "$1" = -e ]]; do regex=( $regex "$2" ) shift 2 done if (( ! $#regex )); then regex=( "$1" ) shift fi regex=( "-e s/${^regex[@]}/$htext&$ntext/g" ) sed ${(Ff)regex[@]} "$@" --------------C329455EB72709AD61FE5480 Content-Type: text/plain; charset=us-ascii; name="showargs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="showargs" local arg s (( $# == 1 )) || s=s echo received $# argument$s for arg; do echo -E - ">>$arg<<" done --------------C329455EB72709AD61FE5480--