Subject: Re: minor 'select' snag
From: Bart Schaefer <[email-masked]>
To: [email-masked]
Date: Mon, 15 Feb 2016 08:46:15 -0800
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Feb 15, 12:05am, Martijn Dekker wrote:
}
} If a user presses Ctrl-D (EOF) within a 'select' loop, the REPLY
} variable is left unchanged on zsh. On the other shells with 'select', it
} is cleared, which is the same behaviour as 'read' (including 'read' on
} zsh) and seems more logical.

There are several other differenced of "select" from "read".  For example
zsh's "select" will accept a maximum of 256 bytes of input, doesn't do
any special handling of multibyte characters, won't allow a line to be
continued with a backslash, etc.  In bash,

    select foo in a b c; do loopbody; done

seems to be equivalent to

    while read "?$PS3"; do
     case $REPLY in (1) foo=a;; (2) foo=b;; (3) foo=c;; (*) foo="";; esac
     loopbody
    done

Zsh also prints an extra newline after the select is done.