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

Re: delay argument interpretation



On Jul 22,  9:23am, Andrew Main wrote:
> Subject: Re: delay argument interpretation
>
> Bart Schaefer wrote:
> >    show () {
> >        show=() 
> >        show=($~*) 
> >        print -rc $show
> >    }
> >    alias show='noglob show'
> 
> Why?  What's wrong with
> 
> function show {
>   show=("$@")
>   print -rc -- "$@"
> }

The latter fails to set $show to empty when the pattern doesn't match
anything.  I have nomatch set, so if there's a globbing failure in the
arg list, "show" never executes.  I want to force "show" to start, and
*then* get the globbing failure.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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