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

(z) flag little crazy when '((' closed with *single* ')'



Hello,
so how is (( ... )) splitted by (z)?

~ buf='(( i = 1, i <= size, ++ i ))'; printf "|%s|\n" "${(z)buf}"
|(( i = 1, i <= size, ++ i ))|

~ buf='(( i = 1, i <= size, ++ i'; printf "|%s|\n" "${(z)buf}"
|(( i = 1, i <= size, ++ i|

OK, but look what happens when there is single ')', not 0, not 2, but
1 closing parenthesis:

~ buf='(( i = 1, i <= size, ++ i )'; printf "|%s|\n" "${(z)buf}"
|(|
|(|
|i|
|=|
|1,|
|i|
|<|
|=|
|size,|
|++|
|i|
|)|

It splits almost char by char. I wonder if this couldn't be fixed? So
that (z) would split this as:

|(( i = 1, i <= size, ++ i )|

-- 
Best regards,
Sebastian Gniazdowski



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