Whamcloud - gitweb
Many files:
[tools/e2fsprogs.git] / lib / et / config_script
1 #!/bin/sh
2 #
3 # This program takes a shell script and configures for the following
4 # variables:    @DIR@
5 #               @AWK@
6 #               @SED@
7 #
8 # Usage: config_script <filename> [<awk>] [<sed>]
9 #
10
11 FILE=$1
12 AWK=$2
13 SED=$3
14
15 # Grr.... not all Unix's have the dirname command
16 TMP=`echo  $1 | sed -e 's;[^/]*$;;' -e 's/^$/./'`
17 DIR=`cd ${TMP}; pwd`
18
19 if test "${AWK}x" = "x" ; then
20         AWK=awk
21 fi
22 if test "${SED}x" = "x" ; then
23         SED=sed
24 fi
25 sed -e "s;@DIR@;${DIR};" -e "s;@AWK@;${AWK};" -e "s;@SED@;${SED};" $FILE