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

Re: Dude, where is noglob?



On Aug 20,  3:24pm, Marc Chantreux wrote:
}
} alias dude!="noglob dude"
} dude () { print "$@" } 
} dude! where is my car?
} 
} alias dude="noglob dude"
} dude () { print "$@" } 
} dude where is my car?

Normally that second one doesn't work because all you've done is create
a function named "noglob" which then takes precedence over the modifier.
You need to define the alias AFTER the function.  Zsh FAQ #2.1 and #2.3.

torch% alias dude!="noglob dude"
torch% dude () { print "$@" }
torch% dude! where is my car?
where is my car?
torch% alias dude="noglob dude"
torch% dude () { print "$@" }
torch% dude where is my car?
zsh: no matches found: car?
torch% alias
dude='noglob dude'
'dude!'='noglob dude'
run-help=man
which-command=whence
torch% functions
dude () {
        print "$@"
}
noglob () {
        print "$@"
}
torch% 

-- 
Barton E. Schaefer



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