Created
January 22, 2014 11:43
-
-
Save dazz/8557351 to your computer and use it in GitHub Desktop.
add license header to all files
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 | |
find . -name '*.php' -type f | while read files | |
do | |
sedtest=$(sed -n '/^/,/$/p' "${files}" | sed -n '/<?php/p') | |
if [ "${sedtest}" ] | |
then | |
echo ${files} | |
sed -e "s@<?php@<?php\n\/\*\*\n \* EasyBib Copyright 2008-2014\n \* Modifying, copying, of code contained herein that is not specifically authorized\n \* by Imagine Easy Solutions LLC ("Company") is strictly prohibited. Violators will\n \* be prosecuted.\n \*\n \* This restriction applies to proprietary code developed by EasyBib. Code from\n \* third-parties or open source projects may be subject to other licensing\n \* restrictions by their respective owners.\n \*\n \* Additional terms can be found at http://www.easybib.com/company/terms\n \*\/@g" "${files}" > "${files}".tmp | |
mv "${files}".tmp "${files}" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you just need to
<?php
with<?php\n ... license