env LC_ALL=C sort
Da página man de sort :
*** WARNING *** The locale specified by the environment affects sort
order. Set LC_ALL=C to get the traditional sort order that uses native
byte values.
Eu tenho a seguinte lista de arquivos classificados de acordo com o Excel:
a1.txt
a10.txt
a11.txt
a12.txt
a2.txt
Se eu usar sort no Unix / Linux, obtenho a seguinte ordem:
a10.txt
a11.txt
a12.txt
a1.txt
a2.txt
onde você pode ver um comportamento diferente para o caractere . . Existe uma opção para obter o mesmo pedido do Excel? Eu tentei -b, -g, -n, ... sem sucesso.
env LC_ALL=C sort
Da página man de sort :
*** WARNING *** The locale specified by the environment affects sort
order. Set LC_ALL=C to get the traditional sort order that uses native
byte values.
Tente o seguinte comando: sort -d ;)