Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: minor 'select' snag
- X-seq: zsh-workers 37985
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: minor 'select' snag
- Date: Mon, 15 Feb 2016 08:46:15 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=idxW9PhC8UmrhTTB5Sco7xWvUlPwDW0Q8ld70oDRyeM=; b=MS7s6UjtgK/goNbbBEgdXwtjYq0EQWLHunJHO6cbVUMynV+q19+FL3JsufGzD5Zhrd R8+FZ9jHH6shvjF8q7LtmAUkO0BrrVvU3AxzZreCA+lbwgeeqBiOJQR8vNUQcUtYJdW6 yyoM9w4GhTqxkbu4wSv7jhKH52+MBwqRIuUP6cFY5HXHfgIPleabUIRZMhjUajoo/S0u TQC8oUi3UQn28tZzp/gnCXthZEk8UieA+4B+8bddQLD1uNeu1EDCqPEzXvSQucxgL4xn lt7/CyceAJFgIOq6KdOpZ1NGIkKF+npU/Z0vmzPiQjnQfsaGJwu34Y16hKw4KCRWY5Ao aiUg==
- In-reply-to: <56C10822.9010107@inlv.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <56C10822.9010107@inlv.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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author