Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-project
Navigation:
Lists: gentoo-project: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-project@g.o
From: Steve Long <slong@...>
Subject: Re: Re: New developer: Ron Gemeinhardt (timebandit)
Date: Mon, 29 Sep 2008 21:08:00 +0100
Nirbheek Chauhan wrote:

> On Fri, Sep 26, 2008 at 2:09 PM, Steve Long <slong@...>
> 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..')




Replies:
Re: Re: Re: New developer: Ron Gemeinhardt (timebandit)
-- Ron Gemeinhardt
References:
New developer: Ron Gemeinhardt (timebandit)
-- Denis Dupeyron
Re: New developer: Ron Gemeinhardt (timebandit)
-- Nirbheek Chauhan
Re: New developer: Ron Gemeinhardt (timebandit)
-- Steve Long
Re: Re: New developer: Ron Gemeinhardt (timebandit)
-- Nirbheek Chauhan
Navigation:
Lists: gentoo-project: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Re: New developer: Ron Gemeinhardt (timebandit)
Next by thread:
Re: Re: Re: New developer: Ron Gemeinhardt (timebandit)
Previous by date:
Re: Re: New developer: Ron Gemeinhardt (timebandit)
Next by date:
Re: Re: Re: New developer: Ron Gemeinhardt (timebandit)


Updated Jun 17, 2009

Summary: Archive of the gentoo-project mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.