Jim Meyering wrote:

> You can do this in perl (or awk, ruby, etc) as a one-liner,
> so it may not be worth adding to a C application:
> 
> echo 1 938 four aa aaaaa | fmt -1 \
>   | perl -ne 'push @line, $_;sub END{print sort {length $a<=>length $b} 
> @line}'
> 1
> aa
> 938
> four
> aaaaa

Not to derail on perl golfing but how about just:

$ perl -e 'print sort {length($a)<=>length($b)} <>' file

Brian


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to