filters.perl 505 B

1234567891011121314151617181920
  1. #!PATH_TO_PERL
  2. while ($_ = shift(@ARGV)) {
  3. if ($_ eq "-f" ) { last; }
  4. if ($_ eq "-file") { last; }
  5. $filters = "$filters | $_";
  6. }
  7. while ($filename = shift(@ARGV)) {
  8. $command = "cat $filename$filters > $filename.tmp";
  9. print STDERR "$command\n";
  10. $ret = system($command);
  11. if ($ret != 0) { die "Command not found. Install perl scripts.\n"; }
  12. $command = "mv $filename.tmp $filename";
  13. print STDERR "$command\n";
  14. $ret = system($command);
  15. if ($ret != 0) { die "Command not found.\n"; }
  16. }
  17. exit (0);