source: obsolete/trunk/VUT/work/tools/replid @ 65

Revision 65, 689 bytes checked in by bittner, 20 years ago (diff)

Merged headers and sources for dummy modules. Added GtpVisibilityPreprocessor?

Line 
1#!/bin/sh
2
3#$Id: replid,v 1.2 1999/11/06 21:23:19 bittner Exp $
4# Initially coding Jiri Bittner
5   
6if [ $# -lt 3 ]; then echo "Usage: replid strA strB file_list $1 $2"; fi
7
8STR1=$1
9STR2=$2
10
11shift
12shift
13FILES=`grep -l $STR1 $*`
14
15echo $FILES
16
17SEPARATORS='[^a-zA-Z0-9_\.]'
18BACKUPDIR="Backup"
19
20if [ ! -d $BACKUPDIR ]; then  mkdir $BACKUPDIR; fi
21
22for FILE in $FILES; do
23 echo "Replacing in $FILE"
24 cp $FILE $BACKUPDIR/$FILE
25 CMD='-e s/\('$SEPARATORS'\)'$STR1'\('$SEPARATORS'\)/\1'$STR2'\2/g -e  s/^'$STR1'\('$SEPARATORS'\)/'$STR2'\1/g  -e  s/\('$SEPARATORS'\)'$STR1'$/\1'$STR2'/g -e  s/^'$STR1'$/'$STR2'/g'
26# echo $CMD
27 sed $CMD < $BACKUPDIR/$FILE > $FILE.tmp
28 mv $FILE.tmp $FILE
29done
30
31
32
33
34
35
36
Note: See TracBrowser for help on using the repository browser.