Commit c439756f authored by Tom Lane's avatar Tom Lane

Make the world safe for QNX's busted shell ...

parent ae8a2c35
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -103,17 +103,23 @@ else ...@@ -103,17 +103,23 @@ else
# where the hostnamepattern is evaluated per the rules of expr(1) --- # where the hostnamepattern is evaluated per the rules of expr(1) ---
# namely, it is a standard regular expression with an implicit ^ at the # namely, it is a standard regular expression with an implicit ^ at the
# start. If multiple lines match, we will end up using the last match. # start. If multiple lines match, we will end up using the last match.
GUESS="" #
exec 4<template/.similar # The tempfile hackery is needed because some shells will run the loop
while read LINE <&4 # inside a subshell, whereupon shell variables set therein aren't seen
# outside the loop :-(
TMPFILE="guesses.$$"
cat /dev/null > $TMPFILE
while read LINE
do do
SIMHOST=`expr "$LINE" : '\(.*\)='` SIMHOST=`expr "$LINE" : '\(.*\)='`
MATCH=`expr "$host" : "$SIMHOST"` MATCH=`expr "$host" : "$SIMHOST"`
if test "$MATCH" != 0 if test "$MATCH" != 0
then GUESS=`echo "$LINE" | sed 's/^.*=//'` then
echo "$LINE" | sed 's/^.*=//' > $TMPFILE
fi fi
done done <template/.similar
exec 4<&- GUESS=`cat $TMPFILE`
rm -f $TMPFILE
if test "$GUESS" if test "$GUESS"
then TEMPLATE="$GUESS" then TEMPLATE="$GUESS"
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment