From owner-freebsd-hackers Sat Jan 5 12:22:44 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from w250.z064001178.sjc-ca.dsl.cnc.net (w250.z064001178.sjc-ca.dsl.cnc.net [64.1.178.250]) by hub.freebsd.org (Postfix) with SMTP id 1717937B419 for ; Sat, 5 Jan 2002 12:22:40 -0800 (PST) Received: (qmail 88203 invoked by uid 1000); 5 Jan 2002 20:23:01 -0000 Date: Sat, 5 Jan 2002 12:22:39 -0801 From: Jos Backus To: freebsd-hackers@freebsd.org Subject: Re: Bug in /bin/sh's handling of case ... esac? Message-ID: <20020105202301.GH90171@lizzy.bugworks.com> Reply-To: Jos Backus Mail-Followup-To: freebsd-hackers@freebsd.org References: <20020105083247.GE90171@lizzy.bugworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020105083247.GE90171@lizzy.bugworks.com> User-Agent: Mutt/1.3.25i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Jan 05, 2002 at 12:32:25AM -0800, Jos Backus wrote: > case "$foo" in > esac > case word in > [(] pattern1) compound-list;; > [[(] pattern[ | pattern] ... ) compound-list;;] ... > [[(] pattern[ | pattern] ... ) compound-list] > esac Never mind, Alexey V. Neyman pointed out that there are no square brackets around the ``[(] pattern1) compound-list;;'' so at least one pattern needs to be present. zsh and bash are simply more forgivig in this case, presumably because there is no harm in doing so. But since empty case statements are mostly useless the standard behavior that flags them makes more sense. -- Jos Backus _/ _/_/_/ Santa Clara, CA _/ _/ _/ _/ _/_/_/ _/ _/ _/ _/ josb@cncdsl.com _/_/ _/_/_/ use Std::Disclaimer; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message