I can't seem to get this any shorter: I want the second through the next-to-last elements of @F joined by " ", and then the last item of @F.
perl -ape '$,=" ";s//>@F[1..$#F-1]\n$F[$#F]/' or (no join, but same general idea): perl -pe 's/\s+(\S+)$/\n$1/;s/^\S+\s+/>/;' What trick am I missing? Thanks! -Aaron