Skip to content

Instantly share code, notes, and snippets.

@ktlim
Last active October 29, 2015 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ktlim/fdaea18ab3d39afdfa8e to your computer and use it in GitHub Desktop.
Save ktlim/fdaea18ab3d39afdfa8e to your computer and use it in GitHub Desktop.
Change in-file notices to new, shorter form.
#!/usr/bin/perl -i.bak
$skipping = 0;
while (<>) {
if ($skipping == 0 && /^(.+) Copyright /) {
print "$1 See the COPYRIGHT and LICENSE files in the top-level directory of this\n";
print "$1 package for notices and licensing terms.\n";
$skipping = 1;
}
elsif ($skipping == 1) {
if (/ see .*LegalNotices/) {
$skipping = 2;
}
}
else {
print;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment