Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Aug 1999 00:18:07 -0700 (PDT)
From:      Doug <Doug@gorean.org>
To:        Chris Costello <chris@calldei.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Please review: rc file changes
Message-ID:  <Pine.BSF.4.10.9908270012140.67160-100000@dt010nb9.san.rr.com>
In-Reply-To: <19990827015429.C18715@holly.calldei.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 27 Aug 1999, Chris Costello wrote:

> On Thu, Aug 26, 1999, Doug wrote:
> > > > 2. value ) instead of value) for case statements
> > > 
> > >    Why?  What's wrong with `value)'?
> > 
> > Nothing functionally, but I find case statements much easier to read with
> > the extra whitespace. 
> 
>    Would that not cause problems?

	Nope. As most things shell it (rightly) ignores the whitespace.
Take a look at this little script to prove it to yourself:

#!/bin/sh

VAR=foo

case $VAR in

        foo )
                echo "I don't care about whitespace"
                ;;
        foo)
                echo "OOoops, guess I do"
                ;;
esac

VAR='foo '

case $VAR in

        foo )
                echo "D'oh! I see the whitespace in the variable"
                ;;
        foo)
                echo "D'oh! I don't see the whitespace in the variable"
                ;;
        'foo ' )
                echo "I see what I am supposed to see"
                ;;
esac

Doug



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?Pine.BSF.4.10.9908270012140.67160-100000>