5

I need to set up command sort, so it is sorting lines into this order:

Akira Kurosawa
Al Ernest Garcia
Alain Sarde
Alan Ladd, Jr.
Albert S. Ruddy
Alberto Grimaldi
Alfred Hitchcock
Amanda Plummer
Frank Pesce
Fred Roos
Fulvio Morsella
Günter Rohrbach
Gale Anne Hurd
Gary Kurtz

(notice handling of whitespace and position of Günter Rohrbach).

I tried various settings of LC_ALL and LC_COLLATE, but I never get this order.

jimmij
  • 46,064
  • 19
  • 123
  • 136

1 Answers1

6

It seems ko_KR.utf8 works, try

LC_COLLATE=ko_KR.utf8 sort file

How have I found this?

for loc in $(locale -a);
    do echo ____"${loc}"____; LC_COLLATE="$loc" sort file;
done | pcregrep -MC1 'wa\nAl (\n|[^_])*Günter Rohrbach\nG'
jimmij
  • 46,064
  • 19
  • 123
  • 136