Date: Wed, 21 Aug 2002 06:18:22 -0700 From: Luigi Rizzo <rizzo@icir.org> To: Neil Blakey-Milner <nbm@mithrandr.moria.org> Cc: arch@FreeBSD.ORG Subject: Re: ugliness in rc.* scripts Message-ID: <20020821061822.A56560@iguana.icir.org> In-Reply-To: <20020821074819.GA58163@mithrandr.moria.org>; from nbm@mithrandr.moria.org on Wed, Aug 21, 2002 at 09:48:19AM %2B0200 References: <20020820232538.A53816@iguana.icir.org> <20020821074819.GA58163@mithrandr.moria.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020821061822.A56560>
