buildroot/package/sed/sedcheck.sh

26 lines
417 B
Bash
Raw Normal View History

#!/bin/sh
2006-04-15 04:27:44 +02:00
# 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
2006-04-15 04:27:44 +02:00
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
2006-04-15 04:27:44 +02:00
if test $? != 0 ; then
echo build-sed-host-binary
2003-11-24 16:55:50 +01:00
else
echo use-sed-host-binary
2006-04-15 04:27:44 +02:00
fi
2006-04-15 04:27:44 +02:00
rm -f .sedtest