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

Commit c6f9464

Browse files
committed
These are further fixes for double quotes missing in the various shell
scripts. Justin Clift
1 parent 7eff804 commit c6f9464

File tree

12 files changed

+53
-53
lines changed

12 files changed

+53
-53
lines changed

src/bin/initdb/initdb.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
2828
# Portions Copyright (c) 1994, Regents of the University of California
2929
#
30-
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.137 2001/09/08 15:24:00 petere Exp $
30+
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.138 2001/09/30 22:17:50 momjian Exp $
3131
#
3232
#-------------------------------------------------------------------------
3333

@@ -539,7 +539,7 @@ EOF
539539
if [ "$?" -ne 0 ]; then
540540
exit_nicely
541541
fi
542-
if [ ! -f $PGDATA/global/pg_pwd ]; then
542+
if [ ! -f "$PGDATA"/global/pg_pwd ]; then
543543
echo
544544
echo "The password file wasn't generated. Please report this problem." 1>&2
545545
exit_nicely

src/bin/initlocation/initlocation.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
#
1111
# IDENTIFICATION
12-
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.11 2001/02/18 18:33:59 momjian Exp $
12+
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.12 2001/09/30 22:17:50 momjian Exp $
1313
#
1414
#-------------------------------------------------------------------------
1515

@@ -125,10 +125,10 @@ trap 'echo "Caught signal." ; exit_nicely' 1 2 3 15
125125
# umask must disallow access to group, other for files and dirs
126126
umask 077
127127

128-
if [ ! -d $PGALTDATA ]; then
128+
if [ ! -d "$PGALTDATA" ]; then
129129
echo "Creating directory $PGALTDATA"
130130
mkdir "$PGALTDATA"
131-
if [ $? -ne 0 ]; then
131+
if [ "$?" -ne 0 ]; then
132132
echo "$CMDNAME: could not create $PGALTDATA" 1>&2
133133
echo "Make sure $PGALTDATA is a valid path and that you have permission to access it." 1>&2
134134
exit_nicely
@@ -139,10 +139,10 @@ else
139139
fi
140140

141141

142-
if [ ! -d $PGALTDATA/base ]; then
142+
if [ ! -d "$PGALTDATA"/base ]; then
143143
echo "Creating directory $PGALTDATA/base"
144144
mkdir "$PGALTDATA/base"
145-
if [ $? -ne 0 ]; then
145+
if [ "$?" -ne 0 ]; then
146146
echo "$CMDNAME: could not create $PGALTDATA/base" 1>&2
147147
echo "Make sure $PGALTDATA/base is a valid path and that you have permission to access it." 1>&2
148148
exit_nicely

src/bin/ipcclean/ipcclean.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.11 2001/05/24 15:53:33 momjian Exp $
3+
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.12 2001/09/30 22:17:50 momjian Exp $
44
#
55

66
CMDNAME=`basename $0`
@@ -74,14 +74,14 @@ if [ `uname` = 'Linux' ]; then
7474
# (This check is conceptually phony, but it's
7575
# useful anyway in practice.)
7676
ps hj $ipcs_cpid $ipcs_lpid >/dev/null 2>&1
77-
if [ $? -eq 0 ]; then
77+
if [ "$?" -eq 0 ]; then
7878
echo "skipped; process still exists (pid $ipcs_cpid or $ipcs_lpid)."
7979
continue
8080
fi
8181

8282
# try remove
8383
ipcrm shm $ipcs_shmid
84-
if [ $? -eq 0 ]; then
84+
if [ "$?" -eq 0 ]; then
8585
did_anything=t
8686
else
8787
exit
@@ -93,7 +93,7 @@ if [ `uname` = 'Linux' ]; then
9393
echo -n "Semaphore $val ... "
9494
# try remove
9595
ipcrm sem $val
96-
if [ $? -eq 0 ]; then
96+
if [ "$?" -eq 0 ]; then
9797
did_anything=t
9898
else
9999
exit

src/bin/pg_config/pg_config.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Author: Peter Eisentraut <peter_e@gmx.net>
88
# Public domain
99

10-
# $Header: /cvsroot/pgsql/src/bin/pg_config/Attic/pg_config.sh,v 1.5 2001/09/16 16:11:11 petere Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/pg_config/Attic/pg_config.sh,v 1.6 2001/09/30 22:17:51 momjian Exp $
1111

1212
me=`basename $0`
1313

@@ -41,7 +41,7 @@ Report bugs to <pgsql-bugs@postgresql.org>."
4141
advice="\
4242
Try '$me --help' for more information."
4343

44-
if test $# -eq 0 ; then
44+
if test "$#" -eq 0 ; then
4545
echo "$me: argument required" 1>&2
4646
echo "$advice" 1>&2
4747
exit 1
@@ -51,7 +51,7 @@ show=
5151

5252
for opt
5353
do
54-
case $opt in
54+
case "$opt" in
5555
--bindir) show="$show \$val_bindir";;
5656
--includedir) show="$show \$val_includedir";;
5757
--includedir-server)

src/bin/pg_dump/pg_dumpall.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# and "pg_group" tables, which belong to the whole installation rather
77
# than any one individual database.
88
#
9-
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.12 2001/05/17 21:12:49 petere Exp $
9+
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.13 2001/09/30 22:17:51 momjian Exp $
1010

1111
CMDNAME=`basename $0`
1212

@@ -77,7 +77,7 @@ cleanschema=
7777
globals_only=
7878

7979

80-
while [ $# -gt 0 ] ; do
80+
while [ "$#" -gt 0 ] ; do
8181
case $1 in
8282
--help)
8383
usage=t

src/bin/scripts/createdb

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#
1313
#
1414
# IDENTIFICATION
15-
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.17 2001/09/22 04:28:12 momjian Exp $
15+
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.18 2001/09/30 22:17:51 momjian Exp $
1616
#
1717
#-------------------------------------------------------------------------
1818

@@ -26,7 +26,7 @@ dbname=
2626
dbcomment=
2727
dbpath=
2828

29-
while [ $# -gt 0 ]
29+
while [ "$#" -gt 0 ]
3030
do
3131
case "$1" in
3232
--help|-\?)
@@ -154,7 +154,7 @@ if [ -z "$dbname" ]; then
154154
else
155155
dbname=`${PATHNAME}pg_id -u -n`
156156
fi
157-
[ $? -ne 0 ] && exit 1
157+
[ "$?" -ne 0 ] && exit 1
158158
fi
159159

160160

@@ -170,7 +170,7 @@ withstring=
170170
[ "$withstring" ] && withstring=" WITH$withstring"
171171

172172
${PATHNAME}psql $PSQLOPT -d template1 -c "CREATE DATABASE \"$dbname\"$withstring"
173-
if [ $? -ne 0 ]; then
173+
if [ "$?" -ne 0 ]; then
174174
echo "$CMDNAME: database creation failed" 1>&2
175175
exit 1
176176
fi
@@ -181,7 +181,7 @@ fi
181181
dbcomment=`echo "$dbcomment" | sed "s/'/\\\\\'/g"`
182182

183183
${PATHNAME}psql $PSQLOPT -d template1 -c "COMMENT ON DATABASE \"$dbname\" IS '$dbcomment'"
184-
if [ $? -ne 0 ]; then
184+
if [ "$?" -ne 0 ]; then
185185
echo "$CMDNAME: comment creation failed (database was created)" 1>&2
186186
exit 1
187187
fi

src/bin/scripts/createlang.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
# Portions Copyright (c) 1994, Regents of the University of California
99
#
10-
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.30 2001/09/22 04:28:12 momjian Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.31 2001/09/30 22:17:51 momjian Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

@@ -37,7 +37,7 @@ fi
3737
# ----------
3838
# Get options, language name and dbname
3939
# ----------
40-
while [ $# -gt 0 ]
40+
while [ "$#" -gt 0 ]
4141
do
4242
case "$1" in
4343
--help|-\?)
@@ -237,7 +237,7 @@ if [ "$showsql" = yes ]; then
237237
echo "$sqlcmd"
238238
fi
239239
res=`$PSQL "$sqlcmd"`
240-
if [ $? -ne 0 ]; then
240+
if [ "$?" -ne 0 ]; then
241241
echo "$CMDNAME: external error" 1>&2
242242
exit 1
243243
fi
@@ -270,7 +270,7 @@ if [ "$handlerexists" = no ]; then
270270
echo "$sqlcmd"
271271
fi
272272
$PSQL "$sqlcmd"
273-
if [ $? -ne 0 ]; then
273+
if [ "$?" -ne 0 ]; then
274274
echo "$CMDNAME: language installation failed" 1>&2
275275
exit 1
276276
fi
@@ -281,7 +281,7 @@ if [ "$showsql" = yes ]; then
281281
echo "$sqlcmd"
282282
fi
283283
$PSQL "$sqlcmd"
284-
if [ $? -ne 0 ]; then
284+
if [ "$?" -ne 0 ]; then
285285
echo "$CMDNAME: language installation failed" 1>&2
286286
exit 1
287287
fi

src/bin/scripts/createuser

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
#
1111
# IDENTIFICATION
12-
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.21 2001/09/22 04:28:12 momjian Exp $
12+
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.22 2001/09/30 22:17:51 momjian Exp $
1313
#
1414
# Note - this should NOT be setuid.
1515
#
@@ -39,7 +39,7 @@ else
3939
fi
4040

4141

42-
while [ $# -gt 0 ]
42+
while [ "$#" -gt 0 ]
4343
do
4444
case "$1" in
4545
--help|-\?)
@@ -174,7 +174,7 @@ trap 'stty echo >/dev/null 2>&1' 1 2 3 15
174174
if [ -z "$NewUser" ]; then
175175
$ECHO_N "Enter name of user to add: "$ECHO_C
176176
read NewUser
177-
[ $? -ne 0 ] && exit 1
177+
[ "$?" -ne 0 ] && exit 1
178178
fi
179179

180180
if [ "$PwPrompt" ]; then
@@ -198,7 +198,7 @@ fi
198198
if [ -z "$CanCreateDb" ]; then
199199
$ECHO_N "Shall the new user be allowed to create databases? (y/n) "$ECHO_C
200200
read REPLY
201-
[ $? -ne 0 ] && exit 1
201+
[ "$?" -ne 0 ] && exit 1
202202
if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then
203203
CanCreateDb=t
204204
else
@@ -209,7 +209,7 @@ fi
209209
if [ -z "$CanAddUser" ]; then
210210
$ECHO_N "Shall the new user be allowed to create more new users? (y/n) "$ECHO_C
211211
read REPLY
212-
[ $? -ne 0 ] && exit 1
212+
[ "$?" -ne 0 ] && exit 1
213213
if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then
214214
CanAddUser=t
215215
else
@@ -239,7 +239,7 @@ SUBQUERY=
239239
[ "$CanAddUser" = f ] && QUERY="$QUERY NOCREATEUSER"
240240

241241
${PATHNAME}psql -c "$QUERY" -d template1 $PSQLOPT
242-
if [ $? -ne 0 ]; then
242+
if [ "$?" -ne 0 ]; then
243243
echo "$CMDNAME: creation of user \"$NewUser\" failed" 1>&2
244244
exit 1
245245
fi

src/bin/scripts/dropdb

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
#
1313
# IDENTIFICATION
14-
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.12 2001/09/22 04:28:12 momjian Exp $
14+
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.13 2001/09/30 22:17:51 momjian Exp $
1515
#
1616
#-------------------------------------------------------------------------
1717

@@ -34,7 +34,7 @@ else
3434
fi
3535

3636

37-
while [ $# -gt 0 ]
37+
while [ "$#" -gt 0 ]
3838
do
3939
case "$1" in
4040
--help|-\?)
@@ -126,15 +126,15 @@ if [ "$forcedel" = f ]; then
126126
$ECHO_N "Are you sure? (y/n) "$ECHO_C
127127
read REPLY
128128

129-
[ $? -eq 1 ] && exit 1
129+
[ "$?" -eq 1 ] && exit 1
130130
[ "$REPLY" != "y" -a "$REPLY" != "Y" ] && exit 0
131131
fi
132132

133133

134134
dbname=`echo $dbname | sed 's/\"/\\\"/g'`
135135

136136
${PATHNAME}psql $PSQLOPT -d template1 -c "DROP DATABASE \"$dbname\""
137-
if [ $? -ne 0 ]; then
137+
if [ "$?" -ne 0 ]; then
138138
echo "$CMDNAME: database removal failed" 1>&2
139139
exit 1
140140
fi

src/bin/scripts/droplang

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
# Portions Copyright (c) 1994, Regents of the University of California
99
#
10-
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.17 2001/09/22 04:28:12 momjian Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.18 2001/09/30 22:17:51 momjian Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

@@ -36,7 +36,7 @@ fi
3636
# ----------
3737
# Get options, language name and dbname
3838
# ----------
39-
while [ $# -gt 0 ]
39+
while [ "$#" -gt 0 ]
4040
do
4141
case "$1" in
4242
--help|-\?)
@@ -168,7 +168,7 @@ if [ "$showsql" = yes ]; then
168168
echo "$sqlcmd"
169169
fi
170170
lanplcallfoid=`$PSQL "$sqlcmd"`
171-
if [ $? -ne 0 ]; then
171+
if [ "$?" -ne 0 ]; then
172172
echo "$CMDNAME: external error" 1>&2
173173
exit 1
174174
fi
@@ -186,13 +186,13 @@ if [ "$showsql" = yes ]; then
186186
echo "$sqlcmd"
187187
fi
188188
res=`$PSQL "$sqlcmd"`
189-
if [ $? -ne 0 ]; then
189+
if [ "$?" -ne 0 ]; then
190190
echo "$CMDNAME: external error" 1>&2
191191
exit 1
192192
fi
193193
if [ "$res" -ne 0 ]; then
194194
echo "$CMDNAME: There are $res functions/trigger procedures declared in language" 1>&2
195-
echo "$langname. Language not removed." 1>&2
195+
echo "$langname. Language not removed." 1>&2
196196
exit 1
197197
fi
198198

@@ -204,7 +204,7 @@ if [ "$showsql" = yes ]; then
204204
echo "$sqlcmd"
205205
fi
206206
res=`$PSQL "$sqlcmd"`
207-
if [ $? -ne 0 ]; then
207+
if [ "$?" -ne 0 ]; then
208208
echo "$CMDNAME: external error" 1>&2
209209
exit 1
210210
fi
@@ -222,7 +222,7 @@ if [ "$showsql" = yes ]; then
222222
echo "$sqlcmd"
223223
fi
224224
$PSQL "$sqlcmd"
225-
if [ $? -ne 0 ]; then
225+
if [ "$?" -ne 0 ]; then
226226
echo "$CMDNAME: language removal failed" 1>&2
227227
exit 1
228228
fi
@@ -239,7 +239,7 @@ if [ "$showsql" = yes ]; then
239239
echo "$sqlcmd"
240240
fi
241241
handler=`$PSQL "$sqlcmd"`
242-
if [ $? -ne 0 ]; then
242+
if [ "$?" -ne 0 ]; then
243243
echo "$CMDNAME: external error" 1>&2
244244
exit 1
245245
fi
@@ -249,7 +249,7 @@ if [ "$showsql" = yes ]; then
249249
echo "$sqlcmd"
250250
fi
251251
$PSQL "$sqlcmd"
252-
if [ $? -ne 0 ]; then
252+
if [ "$?" -ne 0 ]; then
253253
echo "$CMDNAME: language removal failed" 1>&2
254254
exit 1
255255
fi

0 commit comments

Comments
 (0)