1

I wanted to import locale from my computer to a ssh. Therefore I did :

locale > import

Added export on each lines (Do you know any scripting to do it automatically ?)

Copied it from my computer to the ssh :

scp import blablabla@hehehe:~/AFolder

runned it with ./import but nothing changed at all.

  • Please [edit] your question, and add the content of the import file (taken from the remote host) – Yaron Jul 26 '17 at 10:15

1 Answers1

3

Your import file presumably looks something like this:

export LANG=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_PAPER="en_US.UTF-8"
export LC_NAME="en_US.UTF-8"
export LC_ADDRESS="en_US.UTF-8"
export LC_TELEPHONE="en_US.UTF-8"
export LC_MEASUREMENT="en_US.UTF-8"
export LC_IDENTIFICATION="en_US.UTF-8"
export LC_ALL=

first of all, that's not an executable, so you can't just run it. In any case, what you want to do is source it, not execute it (see here for details ont he various ways of executing/sourcing a file). So you want to do . import and not ./import.

As for scripting it, here's a simple way:

locale | sed 's/^/export /' > import
scp import blablabla@hehehe:~/AFolder
ssh blablabla@hehehe
. import
terdon
  • 100,812