Forcing utility output in specific locale (LANG=en_US.UTF-8)
I am running my scripts on machines with different locales and at least who produces different dates depending on the locale.
Code:
$ ssh davidlt@machine 'who -s' Code:
$ LANG=en_US.UTF-8 who -s It looks like env does the magic forcing command to run in the different locale, but only en_US.UTF-8? But it doesn't work on the local machine commands. How do I force command to use en_US.UTF-8 locale? Thanks! David |
Instead of passing LANG to the invocation of ssh, pass it as part of the command that you want ssh to run.
pluto@work$ LANG=lt_LT.UTF-8 ssh home 'env' _=/usr/bin/env HOME=/home/pluto LANG=en_US.UTF-8 LOGNAME=pluto ... pluto@work$ ssh work 'LANG=lt_LT.UTF-8 env' _=/usr/bin/env HOME=/home/pluto LANG=lt_LT.UTF-8 LOGNAME=pluto ... |
All times are GMT -5. The time now is 08:50 AM. |