From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1KkZDI-0008CM-D0 for garchives@archives.gentoo.org; Tue, 30 Sep 2008 07:00:04 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 26E2BE0458; Tue, 30 Sep 2008 07:00:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D278FE0458 for ; Tue, 30 Sep 2008 07:00:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 5EE77647D9 for ; Tue, 30 Sep 2008 07:00:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at gentoo.org X-Spam-Score: -1.473 X-Spam-Level: X-Spam-Status: No, score=-1.473 required=5.5 tests=[AWL=0.059, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1, 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 U-Gg8ZQqaQEa for ; Tue, 30 Sep 2008 06:59:56 +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 DAB2B64C2D for ; Tue, 30 Sep 2008 06:59:55 +0000 (UTC) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KkZD1-0007qx-To for gentoo-project@gentoo.org; Tue, 30 Sep 2008 06:59:47 +0000 Received: from 91.85.135.147 ([91.85.135.147]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Sep 2008 06:59:47 +0000 Received: from slong by 91.85.135.147 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Sep 2008 06:59:47 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-project@lists.gentoo.org From: Steve Long Subject: [gentoo-project] Re: Re: Re: New developer: Ron Gemeinhardt (timebandit) Date: Tue, 30 Sep 2008 07:50:39 +0100 Message-ID: References: <7c612fc60809220552rccadc38me3113a64b4b95b47@mail.gmail.com> <8b4c83ad0809220614n514de148gd5694954ba60cb76@mail.gmail.com> <8b4c83ad0809282227g249e4cfeo7d195fd3672b4536@mail.gmail.com> <48E19E1F.1010607@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Project discussion list X-BeenThere: gentoo-project@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 91.85.135.147 User-Agent: KNode/0.10.9 Sender: news Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 87c07940-fcd6-4fe8-a62e-120fdc876eb7 X-Archives-Hash: c6447b34b6dd32ae8bcc5b134b870cf4 Ron Gemeinhardt wrote: > Steve Long wrote: >> Nirbheek Chauhan wrote: >>> On Fri, Sep 26, 2008 at 2:09 PM, Steve Long >>> wrote: >>>> Nirbheek Chauhan wrote: >>>>> $(for ACRONYM in ${LinkedIn}; do echo -en "${ACRONYM},"; done; echo >>>>> -ne '\b') >>>>> >>>> Now that *is* fail ;-) >>> Crap! I forgot, \b only works for displaying in the terminal; doesn't >>> actually "backspace" :( >>> >> Eh works well enough for display (not file as you mentioned) ... >=20 > Gentlemen, please...can we talk about me for a minute? > Though entertaining, this byplay eats into my allotted fifteen minutes = of > fame. ;-) > LMAO. =20 > Besides, you really want something like: > Heh, you had to go there.. I think you'll fit right in ;-) =20 > echo "knowledge of $(unset last; for ACRONYM in ${LinkedIn[*]}; > do echo -n ${last:+,}$arg; last=3D$arg; done)." >=20 > But I wasn't recruited to be a ebuild dev (Calchan would add, "yet") so= I > won't point that out. >=20 That's good ;p as all that does is what: (IFS=3D,; echo "Knowledge of: ${LinkedIn[*]}") ..does, only not as elegantly (tho I don't like the subshell) nor is it actually correct; quite apart from the typo, it will split on any whitespace, not array members (which can be _any_ string). If you want to iterate over an array, use: for foo in "${array[@]}" Another good one is: printf '%s\n' "${array[@]}" NB: without quotes, there's no difference between ${array[@]} and ${array[*]}. They will both be treated as a string split into parameters according to IFS (space, tab and newline by default; unset IFS only uses space.) This is similar to: echo $foo vs: echo "$foo" Quotes around the * form gives a single string, with each array member separated by the first char of IFS (space by default or if unset, use IFS= =3D =20 to get no separator.) Quotes around the @ form gives every member as a separate parameter (which is what you pretty much always want, except for display.) > Thanks to all for the warm welcome! I promise to do my best to moderat= e > the forums in the capricious, arbitrary and inscrutable--err, I mean, f= air > and balanced--manner to which we're all accustomed. >=20 Glad to hear it, I've often thought the Forums should be more like Fox in proselytising The Gentoo Way?.. *runs*