Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit cfc0ba8

Browse files
committed
Another fix for old shells.
1 parent c446802 commit cfc0ba8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/bin/initlocation/initlocation.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.5 2000/01/19 20:08:25 petere Exp $
11+
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.6 2000/03/25 19:01:48 tgl Exp $
1212
#
1313
#-------------------------------------------------------------------------
1414

@@ -91,13 +91,15 @@ fi
9191
# You can call initlocation $ENVAR, which will of course be resolved
9292
# by the shell, or initlocation some/path (containing at least one slash).
9393
# Then you just take that path.
94-
# This should apease users who are confused by the above behaviour.
94+
# This should appease users who are confused by the above behaviour.
9595
#
9696

97-
if ! echo "$Location" | grep -s '/' >/dev/null 2>&1 && [ ! -d "$Location" ]; then
97+
echo "$Location" | grep '/' >/dev/null 2>&1
98+
99+
if [ "$?" -ne 0 -a ! -d "$Location" ]; then
98100
PGALTDATA=`printenv $Location 2> /dev/null`
99101
if [ -z "$PGALTDATA" ]; then
100-
echo "$CMDNAME: environment variable $PGALTDATA not set"
102+
echo "$CMDNAME: environment variable $Location not set"
101103
exit 1
102104
fi
103105
haveenv=t

0 commit comments

Comments
 (0)