in reply to Golf: reverse sort /etc/passwd by UID
How about this...
perl -e'print$_->[0]for sort{$b->[3]-$a->[3]}map[$_,split/:/],<>' /etc +/passwd
With additional whitespace, that's...
perl -e'print $_->[0] for sort { $b->[3] - $a->[3] } map [$_, split /: +/], <>' /etc/passwd
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Golf: reverse sort /etc/passwd by UID
by Tommy (Chaplain) on Feb 05, 2013 at 17:14 UTC |