Add utility script to do C identifier renaming

This commit is contained in:
Alexander Larsson 2010-01-28 15:38:57 +01:00
parent 9032d5235b
commit cb5909696b

9
rename-identifiers.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
SEDFILE=`mktemp`
awk '$0 !~ /^#.*/ && (NF == 2) { print "s/\\(^\\|[^A-Za-z_]\\)\\(" $1 "\\)\\($\\|[^A-Za-z0-9_]\\)/\\1" $2 "\\3/g" }' $1 > $SEDFILE
shift
sed -f $SEDFILE -i $*
rm $SEDFILE