filters.pl 355 B

12345678910111213141516
  1. #!/usr/local/bin/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 "$command\n";
  10. system($command);
  11. $command = "mv $filename.tmp $filename";
  12. print "$command\n";
  13. system($command);
  14. }