Simplify sort_stable_k2
This commit is contained in:
parent
4fe095e1c7
commit
27fe6e199d
1 changed files with 1 additions and 2 deletions
|
@ -42,8 +42,7 @@ xgrep() { command grep "$@" || : ; }
|
||||||
sort_C() { LC_ALL=C command sort "$@"; }
|
sort_C() { LC_ALL=C command sort "$@"; }
|
||||||
sort_stable_k2()
|
sort_stable_k2()
|
||||||
{
|
{
|
||||||
awk '{ printf("%08d %s\n", NR, $0) }' | sort_C -k3,3 -k1,1 |
|
awk '{ printf("%08d\t%s\n", NR, $0) }' | sort_C -k3,3 -k1,1 | cut -f 2-
|
||||||
awk '{ print $2 " " $3 }'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tac() { sed '1!G;h;$!d'; }
|
tac() { sed '1!G;h;$!d'; }
|
||||||
|
|
Loading…
Reference in a new issue