From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Vincent Lefevre <vincent@vinc17.org>,
Zsh users list <zsh-users@sunsite.dk>
Subject: Re: zsh-4.04 and w3m browser
Date: Wed, 28 Aug 2002 15:25:00 +0000 [thread overview]
Message-ID: <1020828152500.ZM7603@candle.brasslantern.com> (raw)
In-Reply-To: <20020828130851.GE13666@greux.loria.fr>
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 <http://localhost/globbed?unglobbed>, 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
next prev parent reply other threads:[~2002-08-28 15:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-28 11:23 Arthur Alinovi
2002-08-28 11:27 ` Peter Stephenson
2002-08-28 11:28 ` Roman Neuhauser
2002-08-28 11:30 ` Sven Wischnowsky
2002-08-28 11:36 ` Thomas Köhler
2002-08-28 12:18 ` Vincent Lefevre
2002-08-28 12:50 ` Peter Stephenson
2002-08-28 13:08 ` Vincent Lefevre
2002-08-28 15:25 ` Bart Schaefer [this message]
2002-08-28 15:33 ` Vincent Lefevre
2002-08-28 15:52 ` Bart Schaefer
2002-08-28 16:48 ` Wayne Davison
2002-08-30 5:31 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1020828152500.ZM7603@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=vincent@vinc17.org \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).