fixpaths revision 113908
1254721Semaste#!/bin/sh
2254721Semaste#
3254721Semaste# fixpaths  - substitute makefile variables into text files
4254721Semaste# Usage: fixpaths -Dsomething=somethingelse ...
5254721Semaste
6254721Semastedie() {
7254721Semaste	echo $*
8254721Semaste	exit -1
9254721Semaste}
10254721Semaste
11254721Semastetest -n "`echo $1|grep -- -D`" || \
12254721Semaste	die $0: nothing to do - no substitutions listed!
13254721Semaste
14254721Semastetest -n "`echo $1|grep -- '-D[^=]\+=[^ ]\+'`" || \
15254721Semaste	die $0: error in command line arguments.
16254721Semaste
17254721Semastetest -n "`echo $*|grep -- ' [^-]'`" || \
18254721Semaste	die Usage: $0 '[-Dstring=replacement] [[infile] ...]'
19254721Semaste
20254721Semastesed `echo $*|sed -e 's/-D\([^=]\+\)=\([^ ]*\)/-e s=\1=\2=g/g'`
21254721Semaste
22254721Semasteexit 0
23254721Semaste