public inbox for gentoo-project@lists.gentoo.org
 help / color / mirror / Atom feed
From: Steve Long <slong@rathaus.eclipse.co.uk>
To: gentoo-project@lists.gentoo.org
Subject: [gentoo-project]  Re: Re: Re: New developer: Ron Gemeinhardt (timebandit)
Date: Tue, 30 Sep 2008 07:50:39 +0100	[thread overview]
Message-ID: <gbsioo$pi0$1@ger.gmane.org> (raw)
In-Reply-To: 48E19E1F.1010607@gentoo.org

Ron Gemeinhardt wrote:

> Steve Long wrote:
>> Nirbheek Chauhan wrote:
>>> On Fri, Sep 26, 2008 at 2:09 PM, Steve Long
>>> <slong@rathaus.eclipse.co.uk> 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) ... <snip>
> 
> Gentlemen, please...can we talk about me for a minute?
> Though entertaining, this byplay eats into my allotted fifteen minutes of
> fame. ;-)
>
LMAO.
 
> Besides, you really want something like:
>
Heh, you had to go there.. I think you'll fit right in ;-)
 
> echo "knowledge of $(unset last; for ACRONYM in ${LinkedIn[*]};
> do echo -n ${last:+,}$arg; last=$arg; done)."
> 
> But I wasn't recruited to be a ebuild dev (Calchan would add, "yet") so I
> won't point that out.
> 
That's good ;p as all that does is what:
(IFS=,; 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=  
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 moderate
> the forums in the capricious, arbitrary and inscrutable--err, I mean, fair
> and balanced--manner to which we're all accustomed.
> 
Glad to hear it, I've often thought the Forums should be more like Fox in
proselytising The Gentoo Way?.. *runs*





  reply	other threads:[~2008-09-30  7:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22 12:52 [gentoo-project] New developer: Ron Gemeinhardt (timebandit) Denis Dupeyron
2008-09-22 13:14 ` Nirbheek Chauhan
2008-09-26  8:39   ` [gentoo-project] " Steve Long
2008-09-29  5:27     ` Nirbheek Chauhan
2008-09-29 20:08       ` [gentoo-project] " Steve Long
2008-09-30  3:33         ` Ron Gemeinhardt
2008-09-30  6:50           ` Steve Long [this message]
2008-09-22 23:15 ` [gentoo-project] " Jorge Manuel B. S. Vicetto
2008-09-26  9:24   ` Wernfried Haas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='gbsioo$pi0$1@ger.gmane.org' \
    --to=slong@rathaus.eclipse.co.uk \
    --cc=gentoo-project@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox