From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 806 invoked from network); 28 Aug 2002 15:25:49 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 28 Aug 2002 15:25:49 -0000 Received: (qmail 13520 invoked by alias); 28 Aug 2002 15:25:31 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5311 Received: (qmail 13505 invoked from network); 28 Aug 2002 15:25:30 -0000 From: "Bart Schaefer" Message-Id: <1020828152500.ZM7603@candle.brasslantern.com> Date: Wed, 28 Aug 2002 15:25:00 +0000 In-Reply-To: <20020828130851.GE13666@greux.loria.fr> Comments: In reply to Vincent Lefevre "Re: zsh-4.04 and w3m browser" (Aug 28, 3:08pm) References: <20020828121825.GD13666@greux.loria.fr> <18364.1030539052@csr.com> <20020828130851.GE13666@greux.loria.fr> X-Mailer: Z-Mail (5.0.0 30July97) To: Vincent Lefevre , Zsh users list Subject: Re: zsh-4.04 and w3m browser MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 28, 3:08pm, Vincent Lefevre wrote: } Subject: Re: zsh-4.04 and w3m browser } } except that I really don't like nonomatch, so I won't use it (unless } one can apply nonomatch only to some globterns, e.g. to words starting } with http: or ftp:). Minimally tested, but seems to work: ---- 8< ---- snip ---- 8< ---- function urlglobber { local -a args globbed local arg command="$1" shift for arg do case "${arg}" in (ftp://(|localhost)/*) globbed=( ${~${arg##ftp://(|localhost)}} ) args[$#args+1]=( "${(M)arg##ftp://(|localhost)}${(@)^globbed}" ) ;; ((http(|s)|ftp):*) args[$#args+1]="$arg";; (*) args[$#args+1]=( ${~arg} );; esac done "$command" "${(@)args}" } alias globurl='noglob urlglobber' alias ncftp='globurl ncftp' alias lynx='globurl lynx' alias w3m='globurl w3m' ---- 8< ---- snip ---- 8< ---- Other cases, such as , are left as an excercise for the reader. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net