Nirbheek Chauhan wrote:
> On Mon, Sep 22, 2008 at 6:22 PM, Denis Dupeyron <calchan@g.o>
> wrote:
>> I'm pleased to introduce Ron Gemeinhardt (timebandit) as a new Gentoo
>> developer. Ron will be a moderator with the forums team.
>
> Congrats, Ron, welcome and all that :-)
>
Welcome to the madhouse Ron :D
>> Ron is an electrical engineer in theory and a software architect in
>> practice. Having been in the IT business for more than 25 years
Yay, an old-timer! Excellent :-)
>> he has
>> extensive knowledge of $(for ACRONYM in "${LinkedIn}"; do echo -n "
>> ${ACRONYM},"; done). This also automatically gives him access to the
> [...]
>> PS. The first one who comments about a comma at the end of the script
>> output above gets a free review with me. First-class care guaranteed.
>
> Actually, your fail was more than that.
>
Tsk I thought you were better-mannered bheekling ;p
> If "LinkedIn" were a variable, then
>
> $(for ACRONYM in ${LinkedIn}; do echo -n "${ACRONYM},"; done)
>
> elif "LinkedIn" were an array, then
>
> $(for ACRONYM in "${LinkedIn[@]}"; do echo -n "${ACRONYM},"; done)
>
> Also, the extra comma can be fixed by doing the following:
>
> $(for ACRONYM in ${LinkedIn}; do echo -en "${ACRONYM},"; done; echo -ne
> '\b')
>
Now that *is* fail ;-)
> 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.)
|