aboutsummaryrefslogtreecommitdiffstats
path: root/package/sed/sedcheck.sh
blob: 535ad6023faa9ceaeb70b8da05c856d656d48c3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

# Make sure the host sed supports '-i' (in-place).
# If it doesn't, we'll build and use our own.

if test -x /usr/bin/sed ; then
	SED="/usr/bin/sed"
else
	if test -x /bin/sed ; then
		SED="/bin/sed"
	else
		SED="sed"
	fi
fi

echo "HELLO" > .sedtest
$SED -i -e "s/HELLO/GOODBYE/" .sedtest >/dev/null 2>&1

if test $? != 0 ; then
	echo build-sed-host-binary
else
	echo use-sed-host-binary
fi

rm -f .sedtest