Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Ternary expression in Zsh (was: Feature request – substitutions similar to +, -, :+, :-)
- X-seq: zsh-workers 42077
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>
- Subject: Re: Ternary expression in Zsh (was: Feature request – substitutions similar to +, -, :+, :-)
- Date: Tue, 5 Dec 2017 06:55:18 +0000
- Cc: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Bx+eGC5Pxi9SgOGmBD5iAWXVQuXe/Acw63C2HeguTaw=; b=lelrhd5MJCaUMaTiMTka+bUyaTg0UEpQ+cMlzbDZMO1Aojihu/4VDAjBJxkZ6NCu9N uOw0mllxGgy+pRua5a6cD+/gcfBlOqojhIeCV0Y/IQb6uCuDflFBaoScrXmi4Cbj4vu+ SjuWzaqdJOo/X5QNefze7olcq9QWCFoDfNn6L9C64JkgehUnC6ihgHoJ1vBbV3UOql+h ySeqvi5WboUEfgbPC671rapo79FwH7rl3IfYomRJUSNxFWcNSFwF1rTf47IW2bVaEWzt ag2m02X6DTsCd1eUHgtCoM8+RRgFY24bFp9Y0oFKlH+/exfMBiBsYtCUe+PEED+7H9J2 x2zQ==
- In-reply-to: <etPan.5a23bfae.35a1d3d8.c73c@zdharma.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <etPan.5a107666.74b42c6c.137@zdharma.org> <etPan.5a107a4b.459f7f60.137@zdharma.org> <etPan.5a10805d.57d72d7c.137@AirmailxGenerated.am> <etPan.5a1950df.46f9693d.c73c@zdharma.org> <etPan.5a23bfae.35a1d3d8.c73c@zdharma.org>
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
- References:
- Feature request – substitutions similar to +, -, :+, :-
- From: Sebastian Gniazdowski
- Re: Feature request – substitutions similar to +, -, :+, :-
- From: Sebastian Gniazdowski
- Re: Feature request – substitutions similar to +, -, :+, :-
- From: Sebastian Gniazdowski
- Ternary expression in Zsh (was: Feature request – substitutions similar to +, -, :+, :-)
- From: Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author