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

while alias



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


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