Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] Colors and locale warning

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Arwed von Merkatz <v.merkatz AT gmx.net>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] Colors and locale warning
  • Date: Mon, 17 May 2004 13:03:34 +0200

On Mon, May 17, 2004 at 10:35:23AM +0200, Vladim?r Marek wrote:
> Hello,
>
> I would like to warn when parsing output of external programs in
> sorcery, that they may be in different language, or setting.
>
> I casted bash-completion and it was pharting on me bad, with messages
> like "/var/lib/sorcery/modules/libapi no such file or directory". The
> problem was, that 'ls' is actually 'alias ls="ls --color"' and so that
> sorcery had line:
>
> for MODULE in `ls $SGL_LIBRARY_MODULES/lib*[^~]`; do

That's very bad anyway, using for SOMETHING in `ls ...` can break in so
many ways ...
Why not just
for MODULE in "$SGL_LIBRARY_MODULES"/lib*[^~]; do

That will even work if SGL_LIBRARY_MODULES contains spaces or other
crap.

> which don't play nice with colors (I allready fixed it in p4).
>
> Similar may happen if you rely on command outputting text in english,
> and user has LANG or LC_whatever set to his own locale.
>
> If I am not wrong, executing binary like
>
> LC_ALL=C whatever
>
> restores all the locales to default, since it overrides all other LC_*
>
> --
> Neuron



> _______________________________________________
> SM-Discuss mailing list
> SM-Discuss AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/sm-discuss


--
Arwed v. Merkatz Source Mage GNU/Linux developer
http://www.sourcemage.org




Archive powered by MHonArc 2.6.24.

Top of Page