Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID
	autolearn=ham autolearn_force=no version=3.4.1
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==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:date:in-reply-to:comments
         :references:to:subject:mime-version:content-type;
        bh=idxW9PhC8UmrhTTB5Sco7xWvUlPwDW0Q8ld70oDRyeM=;
        b=axynAf+bgZS0WSb2hlbMsouKm6t2JDPld2HV1Tw6NN5W6+NBRbv5dQ8woXKjZxub5l
         aZ88Ufzi30NGYBmRjqO/O9GjmU5HzOrVcR4qseq7DxRM9YmOqxi6QMyhuvre9uUxVeLd
         9M/W14gIh2C70vJ73HjTTg8Sw698H8FWjnMdGKYGEkxKOB6nAVYbrbFFm63Gmg/PBcjl
         Am+uol6U+XPt4eoBFy7qYkc4xm0cZQIuMx0I0CGUKS8tEX1B1G/l+5PJjRIO4p91wo+O
         qzETY+Yf4wUYczAy4A0j8TnV2lzkUmW6TwU4nH458Ny/nYwpkqK1LO+4gbizD5JD2w2q
         ijGg==
X-Gm-Message-State: AG10YOSf+8wxUi5lKb7MJuHMUdVEei0o2L8IRqTuEFHZ/W11iM7VgSHnlkCuE6GxxBbQOQ==
X-Received: by 10.98.18.207 with SMTP id 76mr24541692pfs.53.1455554756821;
        Mon, 15 Feb 2016 08:45:56 -0800 (PST)
From: Bart Schaefer <schaefer@brasslantern.com>
Message-Id: <160215084615.ZM26959@torch.brasslantern.com>
Date: Mon, 15 Feb 2016 08:46:15 -0800
In-Reply-To: <56C10822.9010107@inlv.org>
Comments: In reply to Martijn Dekker <martijn@inlv.org>
        "minor 'select' snag" (Feb 15, 12:05am)
References: <56C10822.9010107@inlv.org>
X-Mailer: OpenZMail Classic (0.9.2 24April2005)
To: zsh-workers@zsh.org
Subject: Re: minor 'select' snag
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Seq: zsh-workers 37985

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.

