#!/usr/local/bin/bash
#
#


#------
#   Build the sed editing script.
#------
    cat >temp-sed-edit <<\EOF
s/* Copyright (c) 2000 QUALCOMM/* Copyright (c) 2001 QUALCOMM/g
EOF


#------
#   Get list of all affected source files.
#------
FILE_LIST=`fgrep -l "Copyright (c) 2000 QUALCOMM" */*`


#------
#   Loop through all source files, copying to *.preserve,
#   and replacing the original with an edited version.
#------
for file in $FILE_LIST
do
    echo "editing $file..."

    TEMP_NAME="${file}.preserve"
    if test -f $TEMP_NAME
    then
        echo "  >>> file $TEMP_NAME exists! <<<"
        exit 1
    fi
    mv $file $TEMP_NAME

    sed -f temp-sed-edit $TEMP_NAME > $file
done


