Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: RFC: sh versionator.eclass
Date: Mon, 08 Oct 2007 01:55:52
Message-Id: 200710072143.00580.vapier@gentoo.org
In Reply to: Re: [gentoo-dev] Re: RFC: sh versionator.eclass by Roy Marples
1 On Sunday 07 October 2007, Roy Marples wrote:
2 > On Sun, 2007-10-07 at 01:09 -0400, Mike Frysinger wrote:
3 > > On Tuesday 02 October 2007, George Shapovalov wrote:
4 > > > Tuesday, 2. October 2007, Roy Marples Ви написали:
5 > > > > And here it is
6 > > >
7 > > > - if [[ "${FORTRANC}" = "gfortran" ]]; then
8 > > > + if [ "${FORTRANC}" = "gfortran" ]; then
9 > > >
10 > > > You know, it is funny to see these lines after all those cries about
11 > > > how [ is evil and we should really never ever use it but rather always
12 > > > use [[ form :).
13 > > >
14 > > > Oh, btw, does the compliant sh correctly process the most cited
15 > > > composition? : [ -n $foo ] && [ -z $foo ] && echo "huh?"
16 > > > (straight from devmanual, the primary reason why [ is considered bad)
17 > >
18 > > [...] will crap a brick if foo expands to multiple arguments
19 >
20 > Only if unquoted.
21 >
22 > > which is why
23 > > [[...]] is preferred ... it'll do the sane thing and work correctly
24 >
25 > Which encourages developers not to quote in my view.
26
27 addressing one issue (quoting) while ignoring others (extended syntax) leads
28 to crappy inconsistencies. if the standard you want (POSIX) cant do it all,
29 then nitpicking details is a waste of time.
30 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature