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: New developer: Ron Gemeinhardt (timebandit)
Date: Mon, 29 Sep 2008 21:08:00 +0100	[thread overview]
Message-ID: <gbrd3h$1a5$1@ger.gmane.org> (raw)
In-Reply-To: 8b4c83ad0809282227g249e4cfeo7d195fd3672b4536@mail.gmail.com

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) it's just you
should know about "${arr[*]}" vs "${arr[@]}"
Both are designed to help with scriptin; the first with exactly this issue,
and the latter with handling array parameters correctly, analagous to "$@"
and "$*".
Check out http://wooledge.org:8000/BashFAQ/073 for more nice stuff you can
do with array expansions (as well as scalars.)
>>
>>> So, where's my free review? ;p
>>>
>> isArr LinkedIn || LinkedIn=($LinkedIn)
>> oIFS=$IFS
>> IFS=,                   # This line and next are what you should
>> echo "${LinkedIn[*]}"   # be aware of. cf: /msg greybot $@
>> IFS=$oIFS
>>
>> (We just do: declare -r oIFS=$IFS
>> ..at the start of our scripts, as it makes life easier in the long-run.)
> 
> Sigh... I think it's better to just live with the extra comma :p
> 
Pfft, you were already using an array: $(IFS=,; echo "${LinkedIn[*]}")
would've done. Since there was a subshell there, no need to worry about
saving IFS. Reason I mentioned it is because: unset IFS
isn't the same, and is generally useless compared to IFS=$oIFS ime.
(The isArr line just seemed better than '# if this is not an array..')





  reply	other threads:[~2008-09-29 20:17 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       ` Steve Long [this message]
2008-09-30  3:33         ` [gentoo-project] " Ron Gemeinhardt
2008-09-30  6:50           ` [gentoo-project] " Steve Long
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='gbrd3h$1a5$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