Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh-4.04 and w3m browser
- X-seq: zsh-users 5312
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: Zsh users list <zsh-users@xxxxxxxxxx>
- Subject: Re: zsh-4.04 and w3m browser
- Date: Wed, 28 Aug 2002 17:33:46 +0200
- In-reply-to: <1020828152500.ZM7603@xxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Zsh users list <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20020828121825.GD13666@xxxxxxxxxxxxxx> <18364.1030539052@xxxxxxx> <20020828130851.GE13666@xxxxxxxxxxxxxx> <1020828152500.ZM7603@xxxxxxxxxxxxxxxxxxxxxxx>
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 <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/> - 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author