From owner-freebsd-arch Wed Aug 21 6:18:32 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 797BC37B43D for ; Wed, 21 Aug 2002 06:18:26 -0700 (PDT) Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3253743E70 for ; Wed, 21 Aug 2002 06:18:26 -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 g7LDIOIb056596; Wed, 21 Aug 2002 06:18:24 -0700 (PDT) (envelope-from rizzo@iguana.icir.org) Received: (from rizzo@localhost) by iguana.icir.org (8.12.3/8.12.3/Submit) id g7LDIN85056595; Wed, 21 Aug 2002 06:18:23 -0700 (PDT) (envelope-from rizzo) Date: Wed, 21 Aug 2002 06:18:22 -0700 From: Luigi Rizzo To: Neil Blakey-Milner Cc: arch@FreeBSD.ORG Subject: Re: ugliness in rc.* scripts Message-ID: <20020821061822.A56560@iguana.icir.org> References: <20020820232538.A53816@iguana.icir.org> <20020821074819.GA58163@mithrandr.moria.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020821074819.GA58163@mithrandr.moria.org>; from nbm@mithrandr.moria.org on Wed, Aug 21, 2002 at 09:48:19AM +0200 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 Wed, Aug 21, 2002 at 09:48:19AM +0200, Neil Blakey-Milner wrote: ... > > 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) ... > I believe the argument for 'case' and those mixed case strings is that > it doesn't spawn a process, whereas "if [ " did at the time. Using > 'echo' and 'tr' and two ``'s will spawn four shells (or something like > that). i think it is only one process -- echo is a builtin, tolower is a shell function. In any case, we never cared about performance in the rc scripts, not spawning processes (e.g. calling scripts with . instead of sh) has only to do with letting variable assignements be visible in the caller. cheers luigi > Neil > -- > Neil Blakey-Milner > nbm@mithrandr.moria.org > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message