Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Aug 1999 10:30:59 +0200
From:      Sheldon Hearn <sheldonh@uunet.co.za>
To:        Doug <Doug@gorean.org>
Cc:        Ben Smithurst <ben@scientia.demon.co.uk>, freebsd-hackers@freebsd.org
Subject:   Re: Please review: rc file changes 
Message-ID:  <80695.936001859@axl.noc.iafrica.com>
In-Reply-To: Your message of "Sat, 28 Aug 1999 16:46:11 MST." <37C874C3.20AA6996@gorean.org> 

next in thread | previous in thread | raw e-mail | index | archive | help


On Sat, 28 Aug 1999 16:46:11 MST, Doug wrote:

> Hoping I'm running out of nits,

:-)

Hi Doug,

I've had a week-end away from a keyboard to think about this. The only
reason we have to use case statements for case-insensitive variable
testing is because sh(1) doesn't offer any upper/lower case handling
parameter expansions (something like ${foo~lower} for example).

When sh(1) _does_ offer something like this, a lot more work will be
involved in using it once your proposed changes have gone in.

Therefore, I propose that we create functions isyes() and isno() to wrap
up the case-handling logic. This means we end up using

	if isyes(${foo}); then
		...
	fi

Later, when upper/lower case handling is available, we could either
change the internals of the isyes() and isno() functions, or replace
their invocations with

	case ${foo~lower} in
	yes)
		...
		;;
	*)
		...
		;;
	esac

Wotchathink?

Ciao,
Sheldon.

PS: I just finished off rc.network; what a bitch. :-)


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?80695.936001859>