From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-dev+bounces-27197-garchives=archives.gentoo.org@gentoo.org>)
	id 1Ihlut-0002nh-JC
	for garchives@archives.gentoo.org; Tue, 16 Oct 2007 12:53:00 +0000
Received: from robin.gentoo.org (localhost [127.0.0.1])
	by robin.gentoo.org (8.14.1/8.14.0) with SMTP id l9GCfrKn005446;
	Tue, 16 Oct 2007 12:41:53 GMT
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by robin.gentoo.org (8.14.1/8.14.0) with ESMTP id l9GCe8Rl003211
	for <gentoo-dev@lists.gentoo.org>; Tue, 16 Oct 2007 12:40:08 GMT
Received: from localhost (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with ESMTP id E8A4864B87
	for <gentoo-dev@lists.gentoo.org>; Tue, 16 Oct 2007 12:40:07 +0000 (UTC)
X-Virus-Scanned: amavisd-new at gentoo.org
X-Spam-Score: -0.302
X-Spam-Level: 
X-Spam-Status: No, score=-0.302 required=5.5 tests=[AWL=0.230,
	BAYES_00=-2.599, RCVD_NUMERIC_HELO=2.067]
Received: from smtp.gentoo.org ([127.0.0.1])
	by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id IK5Y7la1oe7h for <gentoo-dev@lists.gentoo.org>;
	Tue, 16 Oct 2007 12:40:00 +0000 (UTC)
Received: from ciao.gmane.org (main.gmane.org [80.91.229.2])
	(using TLSv1 with cipher AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTP id 1F5B064785
	for <gentoo-dev@gentoo.org>; Tue, 16 Oct 2007 12:39:58 +0000 (UTC)
Received: from list by ciao.gmane.org with local (Exim 4.43)
	id 1Ihlet-000491-1S
	for gentoo-dev@gentoo.org; Tue, 16 Oct 2007 12:36:27 +0000
Received: from 82.152.99.146 ([82.152.99.146])
        by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <gentoo-dev@gentoo.org>; Tue, 16 Oct 2007 12:36:27 +0000
Received: from slong by 82.152.99.146 with local (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <gentoo-dev@gentoo.org>; Tue, 16 Oct 2007 12:36:27 +0000
X-Injected-Via-Gmane: http://gmane.org/
To: gentoo-dev@lists.gentoo.org
From:  Steve Long <slong@rathaus.eclipse.co.uk>
Subject: [gentoo-dev]  Re: Re: Re: [gentoo-commits] gentoo-x86 commit in dev-php5/onphp: ChangeLog onphp-0.10.6.ebuild onphp-0.10.4.ebuild onphp-0.10.3.ebuild
Date:  Tue, 16 Oct 2007 13:38:21 +0100
Message-ID:  <ff2b49$v28$1@ger.gmane.org>
References:  <E1Ih7qa-0007Zq-2s@stork.gentoo.org> <20071014211125.GB23990@supernova> <20071014235246.GA19544@phaenix.haell.com> <20071015022506.461cea64@eusebe> <ff1oen$33k$1@ger.gmane.org> <20071016072812.GT23990@supernova> <1192520674.3687.1.camel@uberpc.marples.name>
Precedence: bulk
List-Post: <mailto:gentoo-dev@lists.gentoo.org>
List-Help: <mailto:gentoo-dev+help@gentoo.org>
List-Unsubscribe: <mailto:gentoo-dev+unsubscribe@gentoo.org>
List-Subscribe: <mailto:gentoo-dev+subscribe@gentoo.org>
List-Id: Gentoo Linux mail <gentoo-dev.gentoo.org>
X-BeenThere: gentoo-dev@gentoo.org
Reply-to: gentoo-dev@lists.gentoo.org
Mime-Version:  1.0
Content-Type:  text/plain; charset=us-ascii
Content-Transfer-Encoding:  7Bit
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: 82.152.99.146
User-Agent: KNode/0.10.4
Sender: news <news@ger.gmane.org>
X-Archives-Salt: a0ec41e2-ad32-425b-b9f6-7c446b218112
X-Archives-Hash: ae1b95f4340d46632f952c78afa08701

Roy Marples wrote:
> On Tue, 2007-10-16 at 00:28 -0700, Donnie Berkholz wrote:
>> On 08:19 Tue 16 Oct     , Steve Long wrote:
>> > stdDocs=(ChangeLog AUTHORS FEATURES THANKS README CodingStyle TODO FAQ)
>> > 
>> > stdDoc() {
>> >         local d l=()
>> >         for d in "${stdDocs[@]}"; do
>> >                 [[ -f $d ]] && l+=("$d")
>> >         done
>> >         ((${#l[@]})) && dodoc "${l[@]}"
>> > }
>> > 
>> > (assuming [[ $PWD = $S ]] or whichever is the right one for docs.)
>> 
>> Is it just me, or is this code way more complex than it needs to be? It
>> looks like bashturbation to me. =P
>
LMAO. It's as complex as it needs to be to handle filenames with spaces or
any other character in. Remember: "Looks like it needs quotes there.. $D,
$S.." What, I should write crap script for this esteemed audience, cos you
only currently deal with filenames without spaces? ;P
 
> Nope, it looks like milk and cereal decorating my monitor to me; after
> reading that! :)
>
Hmm..
> You can also do some pattern matching like so
> 
> foo="foo foobar"
> 
> [ "${foo%foobar}" = "${foo}" ] || echo "ends with foobar"
[[ $foo = *foobar ]] && echo "ends with foobar"

> [ "${foo#foobar}" = "${foo}" ] || echo "starts with foo"
[[ $foo = foo* ]] && echo 'oh does it?'

> [ "${foo#* }" = "${foo}" ] || echo "has a space"
>
[[ $foo = *'wow it '*"does as $well"* ]] && echo 'And a whole lot more!'

> So there's no need for convoluted nested case statements.

There's no need for borked script that is counter-intuitive, and doesn't
have a third of the functionality either. Or should *nix only ever support
POSIX APIs for everything? #define _X_OPEN_SOURCE? No? Hmm.. *shrug* ;>

/me wanders down the pub.. *plop*

-- 
gentoo-dev@gentoo.org mailing list