check-host-sed.sh: use mktemp for temporary file

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
Peter Korsgaard 2010-06-21 22:33:51 +02:00
parent b50fedbcd3
commit bec3480a44

View File

@ -12,9 +12,10 @@ do
fi
fi
echo "HELLO" > .sedtest
$SED -i -e "s/HELLO/GOODBYE/" .sedtest >/dev/null 2>&1
RESULT=$(cat .sedtest)
tmp=$(mktemp)
echo "HELLO" > $tmp
$SED -i -e "s/HELLO/GOODBYE/" $tmp >/dev/null 2>&1
RESULT=$(cat $tmp)
if test $? != 0 ; then
SED=""
@ -26,7 +27,7 @@ do
SED=""
fi
rm -f .sedtest
rm -f $tmp
if [ ! -z "$SED" ] ; then
break
fi