about summary refs log tree commit diff stats
path: root/linux/scripts/replace.sh
diff options
context:
space:
mode:
Diffstat (limited to 'linux/scripts/replace.sh')
-rwxr-xr-xlinux/scripts/replace.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/linux/scripts/replace.sh b/linux/scripts/replace.sh
new file mode 100755
index 0000000..8d5d8d9
--- /dev/null
+++ b/linux/scripts/replace.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# find and replace string on files
+folder=$1
+oldstring=$2
+newstring=$3
+
+#grep -rl $oldstring $folder | xargs sed -i s@$oldstring@$newstring@g
+grep -rl "$oldstring" $folder | xargs sed -i "s@$oldstring@$newstring@g"