From owner-freebsd-arch Tue Aug 20 23:25:48 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C35D037B400 for ; Tue, 20 Aug 2002 23:25:44 -0700 (PDT) Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6916C43E72 for ; Tue, 20 Aug 2002 23:25:44 -0700 (PDT) (envelope-from rizzo@iguana.icir.org) Received: from iguana.icir.org (localhost [127.0.0.1]) by iguana.icir.org (8.12.3/8.11.3) with ESMTP id g7L6PcIb053994; Tue, 20 Aug 2002 23:25:38 -0700 (PDT) (envelope-from rizzo@iguana.icir.org) Received: (from rizzo@localhost) by iguana.icir.org (8.12.3/8.12.3/Submit) id g7L6PcuU053993; Tue, 20 Aug 2002 23:25:38 -0700 (PDT) (envelope-from rizzo) Date: Tue, 20 Aug 2002 23:25:38 -0700 From: Luigi Rizzo To: arch@freebsd.org Subject: ugliness in rc.* scripts Message-ID: <20020820232538.A53816@iguana.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, in various rc.* scripts we have multiple instances of constructs like this: case ${some_config_variable} in [Mm][Ii][Xx][Ed]_[Cc][Aa][Ss][Ee]_[Ss][Tt][Rr][Ii][Nn][Gg]) .... which is not the most desirable thing in terms of readability. This would be easily fixed by moving /usr/bin/tr to /bin/tr (statically linked) and doing tolower() { echo `tr A-Z a-z <<_EOF $*` } case `tolower ${some_config_variable}` in mixed_case_string) ... (btw, i am not sure why, in the above example the _EOF delimited is not required nor i can find any place to put it without being processed as stdin. Perhaps a bug in /bin/sh ?) Anyways, should we go for this ? I believe our scripts would be greatly improved. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message