From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 864 invoked from network); 28 Aug 2002 15:34:36 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 28 Aug 2002 15:34:36 -0000 Received: (qmail 17852 invoked by alias); 28 Aug 2002 15:34:18 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5312 Received: (qmail 17839 invoked from network); 28 Aug 2002 15:34:17 -0000 X-Amavix: Anti-spam check done by SpamAssassin X-Amavix: Anti-virus check done by McAfee X-Amavix: Scanned by Amavix X-Authentication-Warning: greux.loria.fr: lefevre set sender to vincent@vinc17.org using -f Date: Wed, 28 Aug 2002 17:33:46 +0200 From: Vincent Lefevre To: Zsh users list Subject: Re: zsh-4.04 and w3m browser Message-ID: <20020828153346.GF13666@greux.loria.fr> Mail-Followup-To: Zsh users list References: <20020828121825.GD13666@greux.loria.fr> <18364.1030539052@csr.com> <20020828130851.GE13666@greux.loria.fr> <1020828152500.ZM7603@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1020828152500.ZM7603@candle.brasslantern.com> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.1-current-20020801i On Wed, Aug 28, 2002 at 15:25:00 +0000, Bart Schaefer wrote: > ---- 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< ---- But how to make it work for any command? (and that should work even when there are pipes and so on.) -- Vincent Lefèvre - Web: - 100% validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des Jeux Mathématiques et Logiques, TETRHEX, etc. Work: CR INRIA - computer arithmetic / SPACES project at LORIA