1

I have a problem with localized bash output. Say, I have to run some script on two different machines and then compare its output. It could of be done with grep easily, but one of the machines is localized to give bash output in russian. So "Apr" becomes "Апр" and otherwise exactly same strings turn different.

I don't want to mess with localization directly, as it might be useful in general; but it would be nice to run one particular script completely unlocalized.

The question is, how can I do that?

akalenuk
  • 543
  • 2
  • 6
  • 17

2 Answers2

2

afaik you can't. But what you can do is to set the LANG variable in your script to the locale you want. I think it's a good idea to use the POSIX default locale:

export LANG=C
Pascal Schmiel
  • 1,738
  • 12
  • 17
2

Set the required LC_* vars accordingly.

LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8

would set the output of all programs within these scripts to en_US.utf-8.

Or you could even use the "default" locale named C.

Sven
  • 98,649
  • 14
  • 180
  • 226