Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2000:
[Freeciv-Dev] Re: Makefile depends on english locale to work as intended
Home

[Freeciv-Dev] Re: Makefile depends on english locale to work as intended

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Makefile depends on english locale to work as intended. (PR#575)
From: Greg Wooledge <wooledge@xxxxxxxxxxx>
Date: Wed, 11 Oct 2000 20:55:28 -0400

Gerhard Killesreiter (killesreiter@xxxxxxxxxxxxxxxxxxxxxx) wrote:

> --files-from=$(srcdir)/POTFILES.in 2>&1 | Lang.old=$LANG ; export \
> LANG=""; grep -v "is unknown; will try C" ; export LANG=$Lang.old
> 
> Is this right?

You cannot have a "." in a shell variable name.  Use LANG_OLD instead.

Also, "export foo=bar" is not standard Bourne shell syntax (it works in
ksh and bash but not a true /bin/sh).  You need to separate it out:

    LANG_OLD=$LANG; export LANG_OLD; grep ...

A cleaner way, though, involves a Bourne shell trick that allows you to
set a variable for only a single process.  The syntax for this is:

    foo=bar command [args...]

Thus,

    ... --files-from=$(srcdir)/POTFILES.in 2>&1 |
      LANG="" grep -v "is unknown; will try C"

would be equivalent to what you wrote.

Of course, the problem isn't that *grep* has the wrong locale -- it's the
program that's writing to the pipeline that needs its locale changed.
So you need to move the LANG="" to the previous command in the pipe,
not the grep command.

-- 
Greg Wooledge                    | "Truth belongs to everybody."
wooledge@xxxxxxxxxxx             |   Red Hot Chili Peppers
http://www.kellnet.com/wooledge/ |

Attachment: pgpAGU3icrnHI.pgp
Description: PGP signature


[Prev in Thread] Current Thread [Next in Thread]