seq uses comma as decimal separator

空扰寡人 提交于 2019-12-21 09:16:11

问题


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?


回答1:


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


来源:https://stackoverflow.com/questions/23884934/seq-uses-comma-as-decimal-separator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!