summaryrefslogtreecommitdiff
path: root/src/bin/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/scripts')
-rw-r--r--src/bin/scripts/createdb10
-rw-r--r--src/bin/scripts/createlang.sh10
-rw-r--r--src/bin/scripts/createuser12
-rw-r--r--src/bin/scripts/dropdb8
-rw-r--r--src/bin/scripts/droplang18
-rw-r--r--src/bin/scripts/dropuser10
-rw-r--r--src/bin/scripts/vacuumdb6
7 files changed, 37 insertions, 37 deletions
diff --git a/src/bin/scripts/createdb b/src/bin/scripts/createdb
index 8f88586330a..95e8c12d757 100644
--- a/src/bin/scripts/createdb
+++ b/src/bin/scripts/createdb
@@ -12,7 +12,7 @@
#
#
# 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=
dbcomment=
dbpath=
-while [ $# -gt 0 ]
+while [ "$#" -gt 0 ]
do
case "$1" in
--help|-\?)
@@ -154,7 +154,7 @@ if [ -z "$dbname" ]; then
else
dbname=`${PATHNAME}pg_id -u -n`
fi
- [ $? -ne 0 ] && exit 1
+ [ "$?" -ne 0 ] && exit 1
fi
@@ -170,7 +170,7 @@ withstring=
[ "$withstring" ] && withstring=" WITH$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
exit 1
fi
@@ -181,7 +181,7 @@ fi
dbcomment=`echo "$dbcomment" | sed "s/'/\\\\\'/g"`
${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
exit 1
fi
diff --git a/src/bin/scripts/createlang.sh b/src/bin/scripts/createlang.sh
index 12c54943b75..121fa8cde1a 100644
--- a/src/bin/scripts/createlang.sh
+++ b/src/bin/scripts/createlang.sh
@@ -7,7 +7,7 @@
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
# 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
# ----------
# Get options, language name and dbname
# ----------
-while [ $# -gt 0 ]
+while [ "$#" -gt 0 ]
do
case "$1" in
--help|-\?)
@@ -237,7 +237,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd"
fi
res=`$PSQL "$sqlcmd"`
-if [ $? -ne 0 ]; then
+if [ "$?" -ne 0 ]; then
echo "$CMDNAME: external error" 1>&2
exit 1
fi
@@ -270,7 +270,7 @@ if [ "$handlerexists" = no ]; then
echo "$sqlcmd"
fi
$PSQL "$sqlcmd"
- if [ $? -ne 0 ]; then
+ if [ "$?" -ne 0 ]; then
echo "$CMDNAME: language installation failed" 1>&2
exit 1
fi
@@ -281,7 +281,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd"
fi
$PSQL "$sqlcmd"
-if [ $? -ne 0 ]; then
+if [ "$?" -ne 0 ]; then
echo "$CMDNAME: language installation failed" 1>&2
exit 1
fi
diff --git a/src/bin/scripts/createuser b/src/bin/scripts/createuser
index f5ffb4d9418..fa20aa101cf 100644
--- a/src/bin/scripts/createuser
+++ b/src/bin/scripts/createuser
@@ -9,7 +9,7 @@
#
#
# 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.
#
@@ -39,7 +39,7 @@ else
fi
-while [ $# -gt 0 ]
+while [ "$#" -gt 0 ]
do
case "$1" in
--help|-\?)
@@ -174,7 +174,7 @@ trap 'stty echo >/dev/null 2>&1' 1 2 3 15
if [ -z "$NewUser" ]; then
$ECHO_N "Enter name of user to add: "$ECHO_C
read NewUser
- [ $? -ne 0 ] && exit 1
+ [ "$?" -ne 0 ] && exit 1
fi
if [ "$PwPrompt" ]; then
@@ -198,7 +198,7 @@ fi
if [ -z "$CanCreateDb" ]; then
$ECHO_N "Shall the new user be allowed to create databases? (y/n) "$ECHO_C
read REPLY
- [ $? -ne 0 ] && exit 1
+ [ "$?" -ne 0 ] && exit 1
if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then
CanCreateDb=t
else
@@ -209,7 +209,7 @@ fi
if [ -z "$CanAddUser" ]; then
$ECHO_N "Shall the new user be allowed to create more new users? (y/n) "$ECHO_C
read REPLY
- [ $? -ne 0 ] && exit 1
+ [ "$?" -ne 0 ] && exit 1
if [ "$REPLY" = "y" -o "$REPLY" = "Y" ]; then
CanAddUser=t
else
@@ -239,7 +239,7 @@ SUBQUERY=
[ "$CanAddUser" = f ] && QUERY="$QUERY NOCREATEUSER"
${PATHNAME}psql -c "$QUERY" -d template1 $PSQLOPT
-if [ $? -ne 0 ]; then
+if [ "$?" -ne 0 ]; then
echo "$CMDNAME: creation of user \"$NewUser\" failed" 1>&2
exit 1
fi
diff --git a/src/bin/scripts/dropdb b/src/bin/scripts/dropdb
index 0a9f1661153..75ad3cea762 100644
--- a/src/bin/scripts/dropdb
+++ b/src/bin/scripts/dropdb
@@ -11,7 +11,7 @@
#
#
# 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
fi
-while [ $# -gt 0 ]
+while [ "$#" -gt 0 ]
do
case "$1" in
--help|-\?)
@@ -126,7 +126,7 @@ if [ "$forcedel" = f ]; then
$ECHO_N "Are you sure? (y/n) "$ECHO_C
read REPLY
- [ $? -eq 1 ] && exit 1
+ [ "$?" -eq 1 ] && exit 1
[ "$REPLY" != "y" -a "$REPLY" != "Y" ] && exit 0
fi
@@ -134,7 +134,7 @@ fi
dbname=`echo $dbname | sed 's/\"/\\\"/g'`
${PATHNAME}psql $PSQLOPT -d template1 -c "DROP DATABASE \"$dbname\""
-if [ $? -ne 0 ]; then
+if [ "$?" -ne 0 ]; then
echo "$CMDNAME: database removal failed" 1>&2
exit 1
fi
diff --git a/src/bin/scripts/droplang b/src/bin/scripts/droplang
index 919b237ca53..efe94186aab 100644
--- a/src/bin/scripts/droplang
+++ b/src/bin/scripts/droplang
@@ -7,7 +7,7 @@
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
# 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
# ----------
# Get options, language name and dbname
# ----------
-while [ $# -gt 0 ]
+while [ "$#" -gt 0 ]
do
case "$1" in
--help|-\?)
@@ -168,7 +168,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd"
fi
lanplcallfoid=`$PSQL "$sqlcmd"`
-if [ $? -ne 0 ]; then
+if [ "$?" -ne 0 ]; then
echo "$CMDNAME: external error" 1>&2
exit 1
fi
@@ -186,13 +186,13 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd"
fi
res=`$PSQL "$sqlcmd"`
-if [ $? -ne 0 ]; then
+if [ "$?" -ne 0 ]; then
echo "$CMDNAME: external error" 1>&2
exit 1
fi
if [ "$res" -ne 0 ]; then
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
fi
@@ -204,7 +204,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd"
fi
res=`$PSQL "$sqlcmd"`
-if [ $? -ne 0 ]; then
+if [ "$?" -ne 0 ]; then
echo "$CMDNAME: external error" 1>&2
exit 1
fi
@@ -222,7 +222,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd"
fi
$PSQL "$sqlcmd"
-if [ $? -ne 0 ]; then
+if [ "$?" -ne 0 ]; then
echo "$CMDNAME: language removal failed" 1>&2
exit 1
fi
@@ -239,7 +239,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd"
fi
handler=`$PSQL "$sqlcmd"`
-if [ $? -ne 0 ]; then
+if [ "$?" -ne 0 ]; then
echo "$CMDNAME: external error" 1>&2
exit 1
fi
@@ -249,7 +249,7 @@ if [ "$showsql" = yes ]; then
echo "$sqlcmd"
fi
$PSQL "$sqlcmd"
-if [ $? -ne 0 ]; then
+if [ "$?" -ne 0 ]; then
echo "$CMDNAME: language removal failed" 1>&2
exit 1
fi
diff --git a/src/bin/scripts/dropuser b/src/bin/scripts/dropuser
index fc76b6b01de..ed95ec6c739 100644
--- a/src/bin/scripts/dropuser
+++ b/src/bin/scripts/dropuser
@@ -9,7 +9,7 @@
#
#
# 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.
#
@@ -34,7 +34,7 @@ else
fi
-while [ $# -gt 0 ]
+while [ "$#" -gt 0 ]
do
case "$1" in
--help|-\?)
@@ -121,7 +121,7 @@ fi
if [ -z "$DelUser" ]; then
$ECHO_N "Enter name of user to delete: "$ECHO_C
read DelUser
- [ $? -ne 0 ] && exit 1
+ [ "$?" -ne 0 ] && exit 1
fi
@@ -130,7 +130,7 @@ if [ "$forcedel" = f ]; then
$ECHO_N "Are you sure? (y/n) "$ECHO_C
read REPLY
- [ $? -eq 1 ] && exit 1
+ [ "$?" -eq 1 ] && exit 1
[ "$REPLY" != "y" -a "$REPLY" != "Y" ] && exit 0
fi
@@ -139,7 +139,7 @@ DelUser=`echo "$DelUser" | sed 's/\"/\\\"/g'`
${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
exit 1
fi
diff --git a/src/bin/scripts/vacuumdb b/src/bin/scripts/vacuumdb
index 07b3e094d6d..35c8cc4b3bd 100644
--- a/src/bin/scripts/vacuumdb
+++ b/src/bin/scripts/vacuumdb
@@ -12,7 +12,7 @@
#
#
# 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=
alldb=
quiet=0
-while [ $# -gt 0 ]
+while [ "$#" -gt 0 ]
do
case "$1" in
--help|-\?)
@@ -160,7 +160,7 @@ for db in $dbname
do
[ "$alldb" -a "$quiet" -ne 1 ] && echo "Vacuuming $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
exit 1
fi