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

Re: ${...-...} vs ${...:-...}



On May 28,  9:53am, Andrej Borsenkow wrote:
} Subject: RE: ${...-...} vs ${...:-...}
}
} > } bor@itsrm2% print ${(%)-%l}
} > } 5679KNTXYZhims
} >
} > ${(%)-%l} is ${-} is $- is the option flags.  I can see why this might be
} > baffling, but I don't know what else zsh ought to do.
} >
} Hmm ... output an error message? I mean, ${(...)-} is an $-; but
} ${-blablabla} does not lool like it.

But ${-blablabla} does print an error message:

zsh: bad substitution

The problem with ${(%)-%l} is the leading % sign in the stuff after the
parameter name.  Would you expect ${(%)foo%l} to print an error message?

} Or interpret it as the ${...:-...}?

No, that would be wrong too.

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



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