[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shell portability question
From: |
Gary V . Vaughan |
Subject: |
Re: shell portability question |
Date: |
Sun, 19 Sep 2004 12:28:37 +0100 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Paul!
On 19 Sep 2004, at 05:11, Paul Eggert wrote:
"Gary V.Vaughan" <address@hidden> writes:
# Check that break and continue aren't misused in our portable shell
scripts.
$EGREP -n '[^ ]=[^ ].*(break|continue)' $scripts \
I dunno, but perhaps it's checking for invalid usages like this?
foo=bar break
That would indeed be invalid, but usages like
test -r foo && bar=baz && break
are OK as far as I know.
Okay, thanks for the reply.
I'll change the test to:
$EGREP -n '[^ ]=[^ ]*[ ]*(break|continue)' $scripts
Which will also stop it choking on valid things like this:
foo=bar; break
Cheers,
Gary.
- --
Gary V. Vaughan ())_. address@hidden,gnu.org}
Research Scientist ( '/ http://tkd.kicks-ass.net
GNU Hacker / )= http://www.gnu.org/software/libtool
Technical Author `(_~)_ http://sources.redhat.com/autobook
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (Darwin)
iD8DBQFBTW1qFRMICSmD1gYRAkHzAJ4+5tI+e/A4P+m0Z57f79zbBS4iUACdF4Ii
VW8OWue4Y4o+D/nRGcWxPrc=
=8iRo
-----END PGP SIGNATURE-----