Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd7d51bc

Browse files
committed
Put quotes around environment variables.
1 parent11d9d2c commitd7d51bc

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

‎src/bin/scripts/createdb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
#
1313
# IDENTIFICATION
14-
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.12 2000/11/25 19:05:44 petere Exp $
14+
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.13 2001/01/2105:16:45 momjian Exp $
1515
#
1616
#-------------------------------------------------------------------------
1717

@@ -73,19 +73,19 @@ do
7373
dbpath="$2"
7474
shift;;
7575
-D*)
76-
dbpath=`echo$1| sed's/^-D//'`
76+
dbpath=`echo"$1"| sed's/^-D//'`
7777
;;
7878
--location=*)
79-
dbpath=`echo$1| sed's/^--location=//'`
79+
dbpath=`echo"$1"| sed's/^--location=//'`
8080
;;
8181
--encoding|-E)
82-
MB=$2
82+
MB="$2"
8383
shift;;
8484
-E*)
85-
MB=`echo$1| sed's/^-E//'`
85+
MB=`echo"$1"| sed's/^-E//'`
8686
;;
8787
--encoding=*)
88-
MB=`echo$1| sed's/^--encoding=//'`
88+
MB=`echo"$1"| sed's/^--encoding=//'`
8989
;;
9090
-*)
9191
echo"$CMDNAME: invalid option:$1"1>&2
@@ -138,7 +138,7 @@ fi
138138

139139
if [-z"$dbname" ];then
140140
if ["$PGUSER" ];then
141-
dbname=$PGUSER
141+
dbname="$PGUSER"
142142
else
143143
dbname=`${PATHNAME}pg_id -u -n`
144144
fi
@@ -147,8 +147,8 @@ fi
147147

148148

149149
# escape the quotes
150-
dbpath=`echo$dbpath| sed"s/'/\\\\\'/g"`
151-
dbname=`echo$dbname| sed's/\"/\\\"/g'`
150+
dbpath=`echo"$dbpath"| sed"s/'/\\\\\'/g"`
151+
dbname=`echo"$dbname"| sed's/\"/\\\"/g'`
152152

153153
withstring=
154154
["$dbpath" ]&& withstring="$withstring LOCATION = '$dbpath'"
@@ -164,7 +164,7 @@ fi
164164
# Insert comment as well, if requested
165165
[-z"$dbcomment" ]&&exit 0
166166

167-
dbcomment=`echo$dbcomment| sed"s/'/\\\\\'/g"`
167+
dbcomment=`echo"$dbcomment"| sed"s/'/\\\\\'/g"`
168168

169169
${PATHNAME}psql$PSQLOPT -d template1 -c"COMMENT ON DATABASE\"$dbname\" IS '$dbcomment'"
170170
if [$?-ne 0 ];then

‎src/bin/scripts/createlang.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.21 2000/11/25 19:05:44 petere Exp $
11+
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.22 2001/01/2105:16:45 momjian Exp $
1212
#
1313
#-------------------------------------------------------------------------
1414

@@ -81,20 +81,20 @@ do
8181
dbname="$2"
8282
shift;;
8383
-d*)
84-
dbname=`echo$1| sed's/^-d//'`
84+
dbname=`echo"$1"| sed's/^-d//'`
8585
;;
8686
--dbname=*)
87-
dbname=`echo$1| sed's/^--dbname=//'`
87+
dbname=`echo"$1"| sed's/^--dbname=//'`
8888
;;
8989
# misc options
9090
--pglib|-L)
9191
PGLIB="$2"
9292
shift;;
9393
-L*)
94-
PGLIB=`echo$1| sed's/^-L//'`
94+
PGLIB=`echo"$1"| sed's/^-L//'`
9595
;;
9696
--pglib=*)
97-
PGLIB=`echo$1| sed's/^--pglib=//'`
97+
PGLIB=`echo"$1"| sed's/^--pglib=//'`
9898
;;
9999

100100
-*)

‎src/bin/scripts/createuser

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.15 2000/11/25 19:05:44 petere Exp $
11+
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.16 2001/01/2105:16:45 momjian Exp $
1212
#
1313
# Note - this should NOT be setuid.
1414
#
@@ -97,13 +97,13 @@ do
9797
CanAddUser=f
9898
;;
9999
--sysid|-i)
100-
SysID=$2
100+
SysID="$2"
101101
shift;;
102102
--sysid=*)
103-
SysID=`echo$1| sed's/^--sysid=//'`
103+
SysID=`echo"$1"| sed's/^--sysid=//'`
104104
;;
105105
-i*)
106-
SysID=`echo$1| sed's/^-i//'`
106+
SysID=`echo"$1"| sed's/^-i//'`
107107
;;
108108
--pwprompt|--pw|-P)
109109
PwPrompt=t
@@ -114,7 +114,7 @@ do
114114
exit 1
115115
;;
116116
*)
117-
NewUser=$1
117+
NewUser="$1"
118118
;;
119119
esac
120120
shift;
@@ -182,14 +182,14 @@ if [ "$PwPrompt" ]; then
182182
echo"Passwords didn't match."1>&2
183183
exit 1
184184
fi
185-
Password=$FirstPw
185+
Password="$FirstPw"
186186
fi
187187

188188
if [-z"$CanCreateDb" ];then
189189
$ECHO_N"Shall the new user be allowed to create databases? (y/n)"$ECHO_C
190190
read REPLY
191191
[$?-ne 0 ]&&exit 1
192-
if [$REPLY="y"-o$REPLY="Y" ];then
192+
if ["$REPLY"="y"-o"$REPLY"="Y" ];then
193193
CanCreateDb=t
194194
else
195195
CanCreateDb=f
@@ -200,7 +200,7 @@ if [ -z "$CanAddUser" ]; then
200200
$ECHO_N"Shall the new user be allowed to create more new users? (y/n)"$ECHO_C
201201
read REPLY
202202
[$?-ne 0 ]&&exit 1
203-
if [$REPLY="y"-o$REPLY="Y" ];then
203+
if ["$REPLY"="y"-o"$REPLY"="Y" ];then
204204
CanAddUser=t
205205
else
206206
CanAddUser=f
@@ -211,8 +211,8 @@ fi
211211
#
212212
# build SQL command
213213
#
214-
NewUser=`echo$NewUser| sed's/\"/\\\"/g'`
215-
Password=`echo$Password| sed's/\"/\\\"/g'`
214+
NewUser=`echo"$NewUser"| sed's/\"/\\\"/g'`
215+
Password=`echo"$Password"| sed's/\"/\\\"/g'`
216216

217217
QUERY="CREATE USER\"$NewUser\""
218218

‎src/bin/scripts/droplang

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.11 2000/11/25 19:05:44 petere Exp $
11+
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.12 2001/01/2105:16:45 momjian Exp $
1212
#
1313
#-------------------------------------------------------------------------
1414

@@ -81,10 +81,10 @@ do
8181
dbname="$2"
8282
shift;;
8383
-d*)
84-
dbname=`echo$1| sed's/^-d//'`
84+
dbname=`echo"$1"| sed's/^-d//'`
8585
;;
8686
--dbname=*)
87-
dbname=`echo$1| sed's/^--dbname=//'`
87+
dbname=`echo"$1"| sed's/^--dbname=//'`
8888
;;
8989

9090
-*)
@@ -203,7 +203,7 @@ if [ $? -ne 0 ]; then
203203
echo"$CMDNAME: external error"1>&2
204204
exit 1
205205
fi
206-
if [$res-ne 0 ];then
206+
if ["$res"-ne 0 ];then
207207
echo"$CMDNAME: There are$res functions/trigger procedures declared in language"1>&2
208208
echo"$lancomp. Language not removed."1>&2
209209
exit 1

‎src/bin/scripts/dropuser

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.10 2000/11/25 19:05:44 petere Exp $
11+
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.11 2001/01/2105:16:45 momjian Exp $
1212
#
1313
# Note - this should NOT be setuid.
1414
#
@@ -134,7 +134,7 @@ if [ "$forcedel" = f ]; then
134134
fi
135135

136136

137-
DelUser=`echo$DelUser| sed's/\"/\\\"/g'`
137+
DelUser=`echo"$DelUser"| sed's/\"/\\\"/g'`
138138

139139
${PATHNAME}psql$PSQLOPT -d template1 -c"DROP USER\"$DelUser\""
140140

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp