perl -e "print sort {$a <=> $b} <>" test.txt [download]
In reply to Re^3: Sorting within a file by sh1tn in thread Sorting within a file by Anonymous Monk