aboutsummaryrefslogtreecommitdiff
path: root/src/chg
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2007-10-07 00:36:34 +0200
committerjcid <devnull@localhost>2007-10-07 00:36:34 +0200
commit93715c46a99c96d6c866968312691ec9ab0f6a03 (patch)
tree573f19ec6aa740844f53a7c0eb7114f04096bf64 /src/chg
Initial revision
Diffstat (limited to 'src/chg')
-rwxr-xr-xsrc/chg28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/chg b/src/chg
new file mode 100755
index 00000000..32d525f7
--- /dev/null
+++ b/src/chg
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Shell script for name changing source code
+#
+
+if [ ! $# = 3 ]; then
+ echo "Usage: chg <source> <old_word> <new_word>"
+ echo " (this script changes <source> directly)"
+ exit 1
+fi
+
+if [ ! -r $1 ]; then
+ echo "source file ->$1<- doesn't exist..."
+ exit 1
+fi
+
+if [ ! -r $1.BAK ]; then
+ echo "creating backup file: $1.BAK"
+ cp $1 $1.BAK
+fi
+
+sed "s/$2/$3/g" $1 > out
+#sed s/$2/$3/ $1 > out
+rm $1
+mv out $1
+echo "done!"
+
+