in reply to Using -i in oneliner with postprocessing
This reverses each of the contents of the files in place. Note that eof becomes true on the last line of each file, not just the last line of all files.perl -ni.bak -e 'push @a, $_; if (eof) { print reverse @a; @a = () }' +file1 file2 file3
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|