Fixed script to properly handle backslash.

Detect PHP by long lead-in.
Updated default copyright yer to 2012.


git-svn-id: http://voip.null.ro/svn/yate@4996 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2012-04-05 12:30:26 +00:00
parent b753ddae00
commit 65fd6e19f2
1 changed files with 6 additions and 6 deletions

View File

@ -1,9 +1,9 @@
#!/bin/sh
#! /bin/bash
# Use: addcopy [pattern [year(s)]]
# Examples:
# addcopy *.php
# addcopy *.cpp 2009-2011
# addcopy '*.php'
# addcopy '*.cpp' 2009-2012
function copyright()
{
@ -37,7 +37,7 @@ EOF
pat="$1"
test -n "$pat" || pat="*"
cpy="$2"
test -n "$cpy" || cpy="2011"
test -n "$cpy" || cpy="2012"
grep -L -r '^ \* Copyright (C) .* Null Team$' $pat | (while read fn; do
@ -50,7 +50,7 @@ case "X$bn" in
trigger=""
;;
*.php)
trigger="<?"
trigger="<?php"
;;
esac
@ -60,7 +60,7 @@ else
echo "Processing: $fn ..."
cp -p "$fn" "$fn.tmp"
(while read; do
(while read -r; do
if [ "X$trigger" = "X" ]; then
trigger="$notrigger"
copyright