Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Ternary expression in Zsh (was: Feature request – substitutions similar to +, -, :+, :-)
> $ true; echo ${${=:-green red}[2-!?]}
> green
> $ false; echo ${${=:-green red}[2-!?]}
> red
The above fails for me:
% true; echo ${${=:-green red}[2-!?]}
recvmsg(3, {msg_name=NULL, msg_namelen=0,
msg_iov=[{iov_base="\1\0\24\0\0\0\0\0?\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource
temporarily unavailable)
recvmsg(3, {msg_name=NULL, msg_namelen=0,
msg_iov=[{iov_base="\1\0\25\0\0\0\0\0@\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource
temporarily unavailable)
recvmsg(3, {msg_name=NULL, msg_namelen=0,
msg_iov=[{iov_base="\1\0\26\0\0\0\0\0A\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource
temporarily unavailable)
recvmsg(3, {msg_name=NULL, msg_namelen=0,
msg_iov=[{iov_base="\1\0\27\0\0\0\0\0B\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource
temporarily unavailable)
recvmsg(3, {msg_name=NULL, msg_namelen=0,
msg_iov=[{iov_base="\1\0\30\0\0\0\0\0C\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(3, {msg_name=NULL, msg_namelen=0,
msg_iov=[{iov_base="\1\0\31\0\0\0\0\0D\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(3, {msg_name=NULL, msg_namelen=0,
msg_iov=[{iov_base="\1\0\32\0\0\0\0\0E\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 64
recvmsg(3, {msg_name=NULL, msg_namelen=0,
msg_iov=[{iov_base="\1\0\34\0\0\0\0\0G\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource
temporarily unavailable)
recvmsg(3, {msg_name=NULL, msg_namelen=0,
msg_iov=[{iov_base="\1\0\35\0\0\0\0\0H\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource
temporarily unavailable)
recvmsg(3, {msg_name=NULL, msg_namelen=0,
msg_iov=[{iov_base="\1\0\36\0\0\0\0\0I\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource
temporarily unavailable)
recvmsg(3, {msg_name=NULL, msg_namelen=0,
msg_iov=[{iov_base="\1\0\37\0\0\0\0\0J\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource
temporarily unavailable)
recvmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\1\0
\0\0\0\0\0K\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource
temporarily unavailable)
recvmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\1\0,
iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0)
And if run from zsh -f:
% true; echo ${${=:-green red}[2-!?]}
zsh: no such event: ]}
Any idea what can be responsible for this?
--
T.
- 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
- Re: Ternary expression in Zsh (was: Feature request – substitutions similar to +, -, :+, :-)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author