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
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