From owner-freebsd-arch Wed Aug 21 0:49: 5 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 EF1B537B400 for ; Wed, 21 Aug 2002 00:49:01 -0700 (PDT) Received: from dragon.nuxi.com (trang.nuxi.com [66.92.13.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3403A43E7B for ; Wed, 21 Aug 2002 00:49:01 -0700 (PDT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.5/8.12.2) with ESMTP id g7L7mp27085667; Wed, 21 Aug 2002 00:48:51 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.5/8.12.5/Submit) id g7L7mp1e085662; Wed, 21 Aug 2002 00:48:51 -0700 (PDT) Date: Wed, 21 Aug 2002 00:48:51 -0700 From: "David O'Brien" To: Luigi Rizzo Cc: arch@freebsd.org Subject: Re: ugliness in rc.* scripts Message-ID: <20020821074851.GA82634@dragon.nuxi.com> Reply-To: developers@freebsd.org Mail-Followup-To: David O'Brien , Luigi Rizzo , arch@freebsd.org References: <20020820232538.A53816@iguana.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020820232538.A53816@iguana.icir.org> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 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 On Tue, Aug 20, 2002 at 11:25:38PM -0700, Luigi Rizzo wrote: > which is not the most desirable thing in terms of readability. Agreed. > 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) > ... This is an interesting idea. For boolean knobs, I'd really like to see us use the NetBSD way: # checkyesno var # Test $1 variable, and warn if not set to YES or NO. # Return 0 if it's "yes" (et al), nonzero otherwise. # checkyesno() { eval _value=\$${1} debug "checkyesno: $1 is set to $_value." case $_value in # "yes", "true", "on", or "1" [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0 ;; # "no", "false", "off", or "0" [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1 ;; *) warn "\$${1} is not set properly." return 1 ;; esac } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message