Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bart's urlglobber question



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@xxxxxxxxxxxxxxxx>
# 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}"
}



Messages sorted by: Reverse Date, Date, Thread, Author