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

Re: Ternary expression in Zsh (was: Feature request – substitutions similar to +, -, :+, :-)



2017-12-03 10:11:10 +0100, Sebastian Gniazdowski:
> On 25 Nov 2017 at 12:15:42, Sebastian Gniazdowski (psprint@xxxxxxxxxxx) wrote:
> > if (VAR) { return "" } else { return "something else" }
> 
> Kept the main point of previous messages. New point – it is actually possible to have ternary expression in Zsh:
[...]

See also:

$ true; echo ${${=:-green red}[2-!?]}
green
$ false; echo ${${=:-green red}[2-!?]}
red

-- 
Stephane



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