zsh-users
 help / color / mirror / code / Atom feed
* while alias
@ 2022-11-08  1:56 Pier Paolo Grassi
  2022-11-08  6:13 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Pier Paolo Grassi @ 2022-11-08  1:56 UTC (permalink / raw)
  To: Zsh-Users List

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

Hello, I have the following alias defined:

WI='while {read -r it; ! [[ $? -ne 0 && -z $it ]]}'

that works fine except in command substitution:

a=$( echo 1 | WI { echo $it } )
zsh: parse error near `}'
zsh: parse error in command substitution

if I substitute the alias with the aliased code all works fine:

a=$( echo 1 | while {read -r it; ! [[ $? -ne 0 && -z $it ]]} { echo $it }
); echo $a
1

alias are normally correctly substituted inside command substitution, what
can it be?

Pier Paolo Grassi

[-- Attachment #2: Type: text/html, Size: 928 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-09 11:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08  1:56 while alias Pier Paolo Grassi
2022-11-08  6:13 ` Bart Schaefer
2022-11-08 12:39   ` Peter Stephenson
2022-11-09 11:11     ` Pier Paolo Grassi

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).