Last active
October 7, 2016 02:17
-
-
Save green-coder/b873537f5dc2834342283f4ecd515240 to your computer and use it in GitHub Desktop.
This prepends a header file to each matching file, recursively on the file system.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
IFS=$'\n' | |
for f in $(find . -name '*.cs') | |
do | |
if ! grep -q Copyright "$f" | |
then | |
cat "$DIR"/copyright_header.txt "$f" >"$f".new && mv "$f".new "$f" | |
fi | |
echo "$f" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment