httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <hart...@ooo.lanl.gov>
Subject perl script for diffing
Date Tue, 11 Apr 1995 12:21:18 GMT

I finally got tired of trying to remember which files I needed
to diff to build a patch, so I wrote a perl script to remind me
as well as do the diff -C3


#!/usr/local/bin/perl

opendir( DIR, "$ENV{PWD}") || die "Unable to open current dir";

while ($_ = readdir(DIR)) {
   if (/\.orig$/) {
      $original = $_;
      s/\.orig$//;
      $new = $_;
      `diff $original $new`;
      if ($?) {
        print "$new\n" unless @ARGV[0];
        print `diff -C3 $original $new` if @ARGV[0];
      }
    }
}

-=-=-=
Without an argument, it'll list the files names *.orig which have
a newer version sans ".orig".

With an argument, it'll   diff -C3  those files, sending the results
to STDOUT.


enjoy,
robh



Mime
View raw message