1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00
freebsd/crypto/openssh/fixpaths

23 lines
499 B
Plaintext
Raw Normal View History

#!/bin/sh
2002-06-27 22:31:32 +00:00
#
# fixpaths - substitute makefile variables into text files
# Usage: fixpaths -Dsomething=somethingelse ...
2002-06-27 22:31:32 +00:00
die() {
echo $*
exit -1
2002-06-27 22:31:32 +00:00
}
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.
2002-06-27 22:31:32 +00:00
test -n "`echo $*|grep -- ' [^-]'`" || \
die Usage: $0 '[-Dstring=replacement] [[infile] ...]'
2002-06-27 22:31:32 +00:00
sed `echo $*|sed -e 's/-D\([^=]\+\)=\([^ ]*\)/-e s=\1=\2=g/g'`
2002-06-27 22:31:32 +00:00
exit 0