$ printf 'foo\nbar\n' >file $ perl -e' for (1..2) { local @ARGV = qw( file ); local $^I = ""; print ">$_" while <>; } ' $ cat file >>foo >>bar