10

I have noticed a strange seq behavior on one of my computers (Ubuntu LTS 14.04): instead of using points as decimal separator it is using commas:

seq 0. 0.1 0.2
0,0
0,1
0,2

The same version of seq (8.21) on my other PC gives the normal points (also same Ubuntu version). The strangest thing is that I am observing the same ill behavior on a remote machine when I ssh into it from the first machine. Even a bash script submitted from the conflictive machine to a job scheduler (slurm) on the remote machine is having this problem. I am very confused. Why (and how!) is this happening?

Miguel
  • 7,497
  • 2
  • 27
  • 46

1 Answers1

8

It's likely the LANG variable or some other locale-specific variable. On a computer where seq behaves "normally" try:

$ LANG=fr_FR seq 0. 0.1 0.2
0,0
0,1
0,2
$ LANG=en_US seq 0. 0.1 0.2
0.0
0.1
0.2
cnicutar
  • 178,505
  • 25
  • 365
  • 392
  • Thanks, this must be related, because `LANG=en_US` fixes the issue on the problematic machine, but `LANG=fr_FR` does not create it on the machine which is working fine. Even more odd, when I `echo $LANG` both machines give `en_US.UTF-8` as output. – Miguel May 27 '14 at 09:03
  • @Miguel There must be some other variable (or maybe you don't have french on the other machine). I am not too familiar with locale stuff, try doing an `env` and see if there's anything interesting (maybe `LC_ALL`) ? – cnicutar May 27 '14 at 09:11
  • 1
    `LC_NUMERIC` was set on my machine to `fi_FI.UTF-8`. Changing it to `en_US.UTF-8` solves the issue. What I don't understand is why `ssh` was passing all the language-related variables to the remote machine. Thanks for your help. – Miguel May 27 '14 at 09:19
  • @Miguel Interesting. Do you have anything in `.ssh/environment` or the like ? – cnicutar May 27 '14 at 09:25
  • Not in either machine. This must be a server problem, because when I ssh into it from machine 1 `echo $LC_NUMERIC` gives `fi_FI.UTC-8` and from machine 2 the result is `en_GB.UTC-8`. Moreover, when I ssh onto my own server the result is the same but the wrong `seq` behavior is not inherited... – Miguel May 27 '14 at 09:36