zsh-users
 help / color / mirror / code / Atom feed
* Bart's urlglobber question
@ 2002-10-03 15:28 Paul Lew
  2002-10-03 16:09 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Lew @ 2002-10-03 15:28 UTC (permalink / raw)
  To: zsh-users

I am trying to use the urlglobber but there is a problem:

    > w3m http://yahoo.com/?id=test&name=paul&addr=home
    zsh: parse error near `&'

    > echo $ZSH_VERSION
    4.0.5

Seems noglob does not handle the '&' because pure simple:

    > noglob foo&bar

will not work either.  So zsh will treat the above statement as:

     'noglob foo' &  and 'bar'

then how can I ever achieve the original goal of not supplying quotes
when using w3m?

BTW, the definitions for w3m is:

    > alias   w3m='globurl w3m'
    > alias   globurl='noglob urlglobber'

The urlglobber came from:
# Bart Schaefer" <schaefer@brasslantern.com>
# Fri, 30 Aug 2002 05:31:59 +0000
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}"
}


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-10-05 19:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-03 15:28 Bart's urlglobber question Paul Lew
2002-10-03 16:09 ` Bart Schaefer
2002-10-03 17:25   ` Bart's urlglobber question [url-magic-space] Paul Lew
2002-10-03 17:55     ` Bart Schaefer
2002-10-05 19:43       ` Bart Schaefer

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).