Skip to content
Snippets Groups Projects
Commit c6f94644 authored by Bruce Momjian's avatar Bruce Momjian
Browse files

These are further fixes for double quotes missing in the various shell

scripts.

Justin Clift
parent 7eff804b
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.137 2001/09/08 15:24:00 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.138 2001/09/30 22:17:50 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -539,7 +539,7 @@ EOF ...@@ -539,7 +539,7 @@ EOF
if [ "$?" -ne 0 ]; then if [ "$?" -ne 0 ]; then
exit_nicely exit_nicely
fi fi
if [ ! -f $PGDATA/global/pg_pwd ]; then if [ ! -f "$PGDATA"/global/pg_pwd ]; then
echo echo
echo "The password file wasn't generated. Please report this problem." 1>&2 echo "The password file wasn't generated. Please report this problem." 1>&2
exit_nicely exit_nicely
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.11 2001/02/18 18:33:59 momjian Exp $ # $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.12 2001/09/30 22:17:50 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -125,10 +125,10 @@ trap 'echo "Caught signal." ; exit_nicely' 1 2 3 15 ...@@ -125,10 +125,10 @@ trap 'echo "Caught signal." ; exit_nicely' 1 2 3 15
# umask must disallow access to group, other for files and dirs # umask must disallow access to group, other for files and dirs
umask 077 umask 077
if [ ! -d $PGALTDATA ]; then if [ ! -d "$PGALTDATA" ]; then
echo "Creating directory $PGALTDATA" echo "Creating directory $PGALTDATA"
mkdir "$PGALTDATA" mkdir "$PGALTDATA"
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: could not create $PGALTDATA" 1>&2 echo "$CMDNAME: could not create $PGALTDATA" 1>&2
echo "Make sure $PGALTDATA is a valid path and that you have permission to access it." 1>&2 echo "Make sure $PGALTDATA is a valid path and that you have permission to access it." 1>&2
exit_nicely exit_nicely
...@@ -139,10 +139,10 @@ else ...@@ -139,10 +139,10 @@ else
fi fi
if [ ! -d $PGALTDATA/base ]; then if [ ! -d "$PGALTDATA"/base ]; then
echo "Creating directory $PGALTDATA/base" echo "Creating directory $PGALTDATA/base"
mkdir "$PGALTDATA/base" mkdir "$PGALTDATA/base"
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: could not create $PGALTDATA/base" 1>&2 echo "$CMDNAME: could not create $PGALTDATA/base" 1>&2
echo "Make sure $PGALTDATA/base is a valid path and that you have permission to access it." 1>&2 echo "Make sure $PGALTDATA/base is a valid path and that you have permission to access it." 1>&2
exit_nicely exit_nicely
......
#!/bin/sh #!/bin/sh
# #
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.11 2001/05/24 15:53:33 momjian Exp $ # $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.12 2001/09/30 22:17:50 momjian Exp $
# #
CMDNAME=`basename $0` CMDNAME=`basename $0`
...@@ -74,14 +74,14 @@ if [ `uname` = 'Linux' ]; then ...@@ -74,14 +74,14 @@ if [ `uname` = 'Linux' ]; then
# (This check is conceptually phony, but it's # (This check is conceptually phony, but it's
# useful anyway in practice.) # useful anyway in practice.)
ps hj $ipcs_cpid $ipcs_lpid >/dev/null 2>&1 ps hj $ipcs_cpid $ipcs_lpid >/dev/null 2>&1
if [ $? -eq 0 ]; then if [ "$?" -eq 0 ]; then
echo "skipped; process still exists (pid $ipcs_cpid or $ipcs_lpid)." echo "skipped; process still exists (pid $ipcs_cpid or $ipcs_lpid)."
continue continue
fi fi
# try remove # try remove
ipcrm shm $ipcs_shmid ipcrm shm $ipcs_shmid
if [ $? -eq 0 ]; then if [ "$?" -eq 0 ]; then
did_anything=t did_anything=t
else else
exit exit
...@@ -93,7 +93,7 @@ if [ `uname` = 'Linux' ]; then ...@@ -93,7 +93,7 @@ if [ `uname` = 'Linux' ]; then
echo -n "Semaphore $val ... " echo -n "Semaphore $val ... "
# try remove # try remove
ipcrm sem $val ipcrm sem $val
if [ $? -eq 0 ]; then if [ "$?" -eq 0 ]; then
did_anything=t did_anything=t
else else
exit exit
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# Author: Peter Eisentraut <peter_e@gmx.net> # Author: Peter Eisentraut <peter_e@gmx.net>
# Public domain # Public domain
# $Header: /cvsroot/pgsql/src/bin/pg_config/Attic/pg_config.sh,v 1.5 2001/09/16 16:11:11 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/pg_config/Attic/pg_config.sh,v 1.6 2001/09/30 22:17:51 momjian Exp $
me=`basename $0` me=`basename $0`
...@@ -41,7 +41,7 @@ Report bugs to <pgsql-bugs@postgresql.org>." ...@@ -41,7 +41,7 @@ Report bugs to <pgsql-bugs@postgresql.org>."
advice="\ advice="\
Try '$me --help' for more information." Try '$me --help' for more information."
if test $# -eq 0 ; then if test "$#" -eq 0 ; then
echo "$me: argument required" 1>&2 echo "$me: argument required" 1>&2
echo "$advice" 1>&2 echo "$advice" 1>&2
exit 1 exit 1
...@@ -51,7 +51,7 @@ show= ...@@ -51,7 +51,7 @@ show=
for opt for opt
do do
case $opt in case "$opt" in
--bindir) show="$show \$val_bindir";; --bindir) show="$show \$val_bindir";;
--includedir) show="$show \$val_includedir";; --includedir) show="$show \$val_includedir";;
--includedir-server) --includedir-server)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# and "pg_group" tables, which belong to the whole installation rather # and "pg_group" tables, which belong to the whole installation rather
# than any one individual database. # than any one individual database.
# #
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.12 2001/05/17 21:12:49 petere Exp $ # $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_dumpall.sh,v 1.13 2001/09/30 22:17:51 momjian Exp $
CMDNAME=`basename $0` CMDNAME=`basename $0`
...@@ -77,7 +77,7 @@ cleanschema= ...@@ -77,7 +77,7 @@ cleanschema=
globals_only= globals_only=
while [ $# -gt 0 ] ; do while [ "$#" -gt 0 ] ; do
case $1 in case $1 in
--help) --help)
usage=t usage=t
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.17 2001/09/22 04:28:12 momjian Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.18 2001/09/30 22:17:51 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -26,7 +26,7 @@ dbname= ...@@ -26,7 +26,7 @@ dbname=
dbcomment= dbcomment=
dbpath= dbpath=
while [ $# -gt 0 ] while [ "$#" -gt 0 ]
do do
case "$1" in case "$1" in
--help|-\?) --help|-\?)
...@@ -154,7 +154,7 @@ if [ -z "$dbname" ]; then ...@@ -154,7 +154,7 @@ if [ -z "$dbname" ]; then
else else
dbname=`${PATHNAME}pg_id -u -n` dbname=`${PATHNAME}pg_id -u -n`
fi fi
[ $? -ne 0 ] && exit 1 [ "$?" -ne 0 ] && exit 1
fi fi
...@@ -170,7 +170,7 @@ withstring= ...@@ -170,7 +170,7 @@ withstring=
[ "$withstring" ] && withstring=" WITH$withstring" [ "$withstring" ] && withstring=" WITH$withstring"
${PATHNAME}psql $PSQLOPT -d template1 -c "CREATE DATABASE \"$dbname\"$withstring" ${PATHNAME}psql $PSQLOPT -d template1 -c "CREATE DATABASE \"$dbname\"$withstring"
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: database creation failed" 1>&2 echo "$CMDNAME: database creation failed" 1>&2
exit 1 exit 1
fi fi
...@@ -181,7 +181,7 @@ fi ...@@ -181,7 +181,7 @@ fi
dbcomment=`echo "$dbcomment" | sed "s/'/\\\\\'/g"` dbcomment=`echo "$dbcomment" | sed "s/'/\\\\\'/g"`
${PATHNAME}psql $PSQLOPT -d template1 -c "COMMENT ON DATABASE \"$dbname\" IS '$dbcomment'" ${PATHNAME}psql $PSQLOPT -d template1 -c "COMMENT ON DATABASE \"$dbname\" IS '$dbcomment'"
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: comment creation failed (database was created)" 1>&2 echo "$CMDNAME: comment creation failed (database was created)" 1>&2
exit 1 exit 1
fi fi
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.30 2001/09/22 04:28:12 momjian Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.31 2001/09/30 22:17:51 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -37,7 +37,7 @@ fi ...@@ -37,7 +37,7 @@ fi
# ---------- # ----------
# Get options, language name and dbname # Get options, language name and dbname
# ---------- # ----------
while [ $# -gt 0 ] while [ "$#" -gt 0 ]
do do
case "$1" in case "$1" in
--help|-\?) --help|-\?)
...@@ -237,7 +237,7 @@ if [ "$showsql" = yes ]; then ...@@ -237,7 +237,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd" echo "$sqlcmd"
fi fi
res=`$PSQL "$sqlcmd"` res=`$PSQL "$sqlcmd"`
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: external error" 1>&2 echo "$CMDNAME: external error" 1>&2
exit 1 exit 1
fi fi
...@@ -270,7 +270,7 @@ if [ "$handlerexists" = no ]; then ...@@ -270,7 +270,7 @@ if [ "$handlerexists" = no ]; then
echo "$sqlcmd" echo "$sqlcmd"
fi fi
$PSQL "$sqlcmd" $PSQL "$sqlcmd"
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: language installation failed" 1>&2 echo "$CMDNAME: language installation failed" 1>&2
exit 1 exit 1
fi fi
...@@ -281,7 +281,7 @@ if [ "$showsql" = yes ]; then ...@@ -281,7 +281,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd" echo "$sqlcmd"
fi fi
$PSQL "$sqlcmd" $PSQL "$sqlcmd"
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: language installation failed" 1>&2 echo "$CMDNAME: language installation failed" 1>&2
exit 1 exit 1
fi fi
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.21 2001/09/22 04:28:12 momjian Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.22 2001/09/30 22:17:51 momjian Exp $
# #
# Note - this should NOT be setuid. # Note - this should NOT be setuid.
# #
...@@ -39,7 +39,7 @@ else ...@@ -39,7 +39,7 @@ else
fi fi
while [ $# -gt 0 ] while [ "$#" -gt 0 ]
do do
case "$1" in case "$1" in
--help|-\?) --help|-\?)
...@@ -174,7 +174,7 @@ trap 'stty echo >/dev/null 2>&1' 1 2 3 15 ...@@ -174,7 +174,7 @@ trap 'stty echo >/dev/null 2>&1' 1 2 3 15
if [ -z "$NewUser" ]; then if [ -z "$NewUser" ]; then
$ECHO_N "Enter name of user to add: "$ECHO_C $ECHO_N "Enter name of user to add: "$ECHO_C
read NewUser read NewUser
[ $? -ne 0 ] && exit 1 [ "$?" -ne 0 ] && exit 1
fi fi
if [ "$PwPrompt" ]; then if [ "$PwPrompt" ]; then
...@@ -198,7 +198,7 @@ fi ...@@ -198,7 +198,7 @@ fi
if [ -z "$CanCreateDb" ]; then if [ -z "$CanCreateDb" ]; then
$ECHO_N "Shall the new user be allowed to create databases? (y/n) "$ECHO_C $ECHO_N "Shall the new user be allowed to create databases? (y/n) "$ECHO_C
read REPLY read REPLY
[ $? -ne 0 ] && exit 1 [ "$?" -ne 0 ] && exit 1
if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then
CanCreateDb=t CanCreateDb=t
else else
...@@ -209,7 +209,7 @@ fi ...@@ -209,7 +209,7 @@ fi
if [ -z "$CanAddUser" ]; then if [ -z "$CanAddUser" ]; then
$ECHO_N "Shall the new user be allowed to create more new users? (y/n) "$ECHO_C $ECHO_N "Shall the new user be allowed to create more new users? (y/n) "$ECHO_C
read REPLY read REPLY
[ $? -ne 0 ] && exit 1 [ "$?" -ne 0 ] && exit 1
if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then
CanAddUser=t CanAddUser=t
else else
...@@ -239,7 +239,7 @@ SUBQUERY= ...@@ -239,7 +239,7 @@ SUBQUERY=
[ "$CanAddUser" = f ] && QUERY="$QUERY NOCREATEUSER" [ "$CanAddUser" = f ] && QUERY="$QUERY NOCREATEUSER"
${PATHNAME}psql -c "$QUERY" -d template1 $PSQLOPT ${PATHNAME}psql -c "$QUERY" -d template1 $PSQLOPT
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: creation of user \"$NewUser\" failed" 1>&2 echo "$CMDNAME: creation of user \"$NewUser\" failed" 1>&2
exit 1 exit 1
fi fi
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.12 2001/09/22 04:28:12 momjian Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.13 2001/09/30 22:17:51 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -34,7 +34,7 @@ else ...@@ -34,7 +34,7 @@ else
fi fi
while [ $# -gt 0 ] while [ "$#" -gt 0 ]
do do
case "$1" in case "$1" in
--help|-\?) --help|-\?)
...@@ -126,7 +126,7 @@ if [ "$forcedel" = f ]; then ...@@ -126,7 +126,7 @@ if [ "$forcedel" = f ]; then
$ECHO_N "Are you sure? (y/n) "$ECHO_C $ECHO_N "Are you sure? (y/n) "$ECHO_C
read REPLY read REPLY
[ $? -eq 1 ] && exit 1 [ "$?" -eq 1 ] && exit 1
[ "$REPLY" != "y" -a "$REPLY" != "Y" ] && exit 0 [ "$REPLY" != "y" -a "$REPLY" != "Y" ] && exit 0
fi fi
...@@ -134,7 +134,7 @@ fi ...@@ -134,7 +134,7 @@ fi
dbname=`echo $dbname | sed 's/\"/\\\"/g'` dbname=`echo $dbname | sed 's/\"/\\\"/g'`
${PATHNAME}psql $PSQLOPT -d template1 -c "DROP DATABASE \"$dbname\"" ${PATHNAME}psql $PSQLOPT -d template1 -c "DROP DATABASE \"$dbname\""
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: database removal failed" 1>&2 echo "$CMDNAME: database removal failed" 1>&2
exit 1 exit 1
fi fi
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group # Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California # Portions Copyright (c) 1994, Regents of the University of California
# #
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.17 2001/09/22 04:28:12 momjian Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.18 2001/09/30 22:17:51 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -36,7 +36,7 @@ fi ...@@ -36,7 +36,7 @@ fi
# ---------- # ----------
# Get options, language name and dbname # Get options, language name and dbname
# ---------- # ----------
while [ $# -gt 0 ] while [ "$#" -gt 0 ]
do do
case "$1" in case "$1" in
--help|-\?) --help|-\?)
...@@ -168,7 +168,7 @@ if [ "$showsql" = yes ]; then ...@@ -168,7 +168,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd" echo "$sqlcmd"
fi fi
lanplcallfoid=`$PSQL "$sqlcmd"` lanplcallfoid=`$PSQL "$sqlcmd"`
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: external error" 1>&2 echo "$CMDNAME: external error" 1>&2
exit 1 exit 1
fi fi
...@@ -186,13 +186,13 @@ if [ "$showsql" = yes ]; then ...@@ -186,13 +186,13 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd" echo "$sqlcmd"
fi fi
res=`$PSQL "$sqlcmd"` res=`$PSQL "$sqlcmd"`
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: external error" 1>&2 echo "$CMDNAME: external error" 1>&2
exit 1 exit 1
fi fi
if [ "$res" -ne 0 ]; then if [ "$res" -ne 0 ]; then
echo "$CMDNAME: There are $res functions/trigger procedures declared in language" 1>&2 echo "$CMDNAME: There are $res functions/trigger procedures declared in language" 1>&2
echo "$langname. Language not removed." 1>&2 echo "$langname. Language not removed." 1>&2
exit 1 exit 1
fi fi
...@@ -204,7 +204,7 @@ if [ "$showsql" = yes ]; then ...@@ -204,7 +204,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd" echo "$sqlcmd"
fi fi
res=`$PSQL "$sqlcmd"` res=`$PSQL "$sqlcmd"`
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: external error" 1>&2 echo "$CMDNAME: external error" 1>&2
exit 1 exit 1
fi fi
...@@ -222,7 +222,7 @@ if [ "$showsql" = yes ]; then ...@@ -222,7 +222,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd" echo "$sqlcmd"
fi fi
$PSQL "$sqlcmd" $PSQL "$sqlcmd"
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: language removal failed" 1>&2 echo "$CMDNAME: language removal failed" 1>&2
exit 1 exit 1
fi fi
...@@ -239,7 +239,7 @@ if [ "$showsql" = yes ]; then ...@@ -239,7 +239,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd" echo "$sqlcmd"
fi fi
handler=`$PSQL "$sqlcmd"` handler=`$PSQL "$sqlcmd"`
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: external error" 1>&2 echo "$CMDNAME: external error" 1>&2
exit 1 exit 1
fi fi
...@@ -249,7 +249,7 @@ if [ "$showsql" = yes ]; then ...@@ -249,7 +249,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd" echo "$sqlcmd"
fi fi
$PSQL "$sqlcmd" $PSQL "$sqlcmd"
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: language removal failed" 1>&2 echo "$CMDNAME: language removal failed" 1>&2
exit 1 exit 1
fi fi
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.13 2001/09/22 04:28:12 momjian Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.14 2001/09/30 22:17:51 momjian Exp $
# #
# Note - this should NOT be setuid. # Note - this should NOT be setuid.
# #
...@@ -34,7 +34,7 @@ else ...@@ -34,7 +34,7 @@ else
fi fi
while [ $# -gt 0 ] while [ "$#" -gt 0 ]
do do
case "$1" in case "$1" in
--help|-\?) --help|-\?)
...@@ -121,7 +121,7 @@ fi ...@@ -121,7 +121,7 @@ fi
if [ -z "$DelUser" ]; then if [ -z "$DelUser" ]; then
$ECHO_N "Enter name of user to delete: "$ECHO_C $ECHO_N "Enter name of user to delete: "$ECHO_C
read DelUser read DelUser
[ $? -ne 0 ] && exit 1 [ "$?" -ne 0 ] && exit 1
fi fi
...@@ -130,7 +130,7 @@ if [ "$forcedel" = f ]; then ...@@ -130,7 +130,7 @@ if [ "$forcedel" = f ]; then
$ECHO_N "Are you sure? (y/n) "$ECHO_C $ECHO_N "Are you sure? (y/n) "$ECHO_C
read REPLY read REPLY
[ $? -eq 1 ] && exit 1 [ "$?" -eq 1 ] && exit 1
[ "$REPLY" != "y" -a "$REPLY" != "Y" ] && exit 0 [ "$REPLY" != "y" -a "$REPLY" != "Y" ] && exit 0
fi fi
...@@ -139,7 +139,7 @@ DelUser=`echo "$DelUser" | sed 's/\"/\\\"/g'` ...@@ -139,7 +139,7 @@ DelUser=`echo "$DelUser" | sed 's/\"/\\\"/g'`
${PATHNAME}psql $PSQLOPT -d template1 -c "DROP USER \"$DelUser\"" ${PATHNAME}psql $PSQLOPT -d template1 -c "DROP USER \"$DelUser\""
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: deletion of user \"$DelUser\" failed" 1>&2 echo "$CMDNAME: deletion of user \"$DelUser\" failed" 1>&2
exit 1 exit 1
fi fi
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.18 2001/09/22 04:28:12 momjian Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.19 2001/09/30 22:17:51 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -28,7 +28,7 @@ dbname= ...@@ -28,7 +28,7 @@ dbname=
alldb= alldb=
quiet=0 quiet=0
while [ $# -gt 0 ] while [ "$#" -gt 0 ]
do do
case "$1" in case "$1" in
--help|-\?) --help|-\?)
...@@ -160,7 +160,7 @@ for db in $dbname ...@@ -160,7 +160,7 @@ for db in $dbname
do do
[ "$alldb" -a "$quiet" -ne 1 ] && echo "Vacuuming $db" [ "$alldb" -a "$quiet" -ne 1 ] && echo "Vacuuming $db"
${PATHNAME}psql $PSQLOPT $ECHOOPT -c "VACUUM $full $verbose $analyze $table" -d $db ${PATHNAME}psql $PSQLOPT $ECHOOPT -c "VACUUM $full $verbose $analyze $table" -d $db
if [ $? -ne 0 ]; then if [ "$?" -ne 0 ]; then
echo "$CMDNAME: vacuum $table $db failed" 1>&2 echo "$CMDNAME: vacuum $table $db failed" 1>&2
exit 1 exit 1
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment