1
I am writing a bash script and I want to make it portable, to have the same results in the other computers.
From this question I learned the system settings, like language settings and possibly other variables, can affect the results of exactly the same sort command on exactly the same input file and arguments.
So my question is how to use sort and to ensure the expected result in the other systems? Which system variables should I consider? Does putting LC_ALL=C
b solve all the problem?
i had a similar problem, maybe this could help you. http://stackoverflow.com/questions/10486736/how-do-i-sort-these-values-using-bash-script-in-linux
– maths – 2014-10-22T23:14:44.5831Read the
sort
man page for each intended system. For GNU systems (i.e. Linux), more detail can be found withinfo sort
, especially see the footnote. – glenn jackman – 2014-10-22T23:33:25.683