http://www.perlmonks.org?node_id=126066


in reply to Sorting a file and printing it back onto itself

One-liner :)
$ perl -i.bak -0777pe'$_=join"\n",sort(split /\n/),""' users.dat $ cat users.dat.bak me you them she he it we $cat users.dat he it me she them we you