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