in reply to Using -i in oneliner with postprocessing

On the other paw, there's the shell version of a Schwartzian Transform:

for i in *.txt do mv $i $i~ perl -ne 'print length, "\t", $_' $i~ | \ sort +0n | uniq | cut -f2- > $i done