summaryrefslogtreecommitdiff
path: root/fixpaths
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@google.com>2011-12-07 08:17:59 -0800
committerMike Lockwood <lockwood@google.com>2012-02-08 10:12:43 -0800
commit1305e95ba6ff9fa202d0818caf10405df4b0f648 (patch)
tree6003d5fc2cb7c43cf28ed53dc9c880500c9bcd98 /fixpaths
parent8273adc47a9f7405a0e038e9364a3c45f3609347 (diff)
Initial commit of openssh-5.9p1
Change-Id: I991b8d22c9904ed6ced33a096776f4f342af52a8 Signed-off-by: Mike Lockwood <lockwood@google.com>
Diffstat (limited to 'fixpaths')
-rwxr-xr-xfixpaths22
1 files changed, 22 insertions, 0 deletions
diff --git a/fixpaths b/fixpaths
new file mode 100755
index 00000000..60a67990
--- /dev/null
+++ b/fixpaths
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# fixpaths - substitute makefile variables into text files
+# Usage: fixpaths -Dsomething=somethingelse ...
+
+die() {
+ echo $*
+ exit -1
+}
+
+test -n "`echo $1|grep -- -D`" || \
+ die $0: nothing to do - no substitutions listed!
+
+test -n "`echo $1|grep -- '-D[^=]\+=[^ ]\+'`" || \
+ die $0: error in command line arguments.
+
+test -n "`echo $*|grep -- ' [^-]'`" || \
+ die Usage: $0 '[-Dstring=replacement] [[infile] ...]'
+
+sed `echo $*|sed -e 's/-D\([^=]\+\)=\([^ ]*\)/-e s=\1=\2=g/g'`
+
+exit 0