You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -25,7 +30,10 @@ if echo "$0" | grep '/' > /dev/null 2>&1 ; then
25
30
else
26
31
# look for it in PATH ('which' command is not portable)
27
32
echo"$PATH"| sed 's/:/\
28
-
/g'|whileread dir;do
33
+
/g'|while:;do
34
+
IFS="$NL"
35
+
read dir ||break
36
+
IFS="$_IFS"
29
37
# empty entry in path means current dir
30
38
[ x"$dir"= x ] && dir='.'
31
39
if [ -f"$dir/$CMDNAME" ] ;then
@@ -197,9 +205,12 @@ echo
197
205
198
206
$PSQL -d template1 -At -F '
199
207
' -c 'SELECT groname,grosysid,grolist FROM pg_group;'| \
200
-
whileread GRONAME ;do
201
-
read GROSYSID
202
-
read GROLIST
208
+
while:;do
209
+
IFS="$NL"
210
+
read GRONAME ||break
211
+
read GROSYSID ||break
212
+
read GROLIST ||break
213
+
IFS="$_IFS"
203
214
echo"CREATE GROUP \"$GRONAME\" WITH SYSID ${GROSYSID};"
204
215
echo"$GROLIST"| sed 's/^{\(.*\)}$/\1/'| tr ',''\n'|
205
216
whileread userid;do
@@ -224,10 +235,12 @@ exec 4<&0
224
235
$PSQL -d template1 -At -F '
225
236
' -c "SELECT datname, coalesce(usename, (select usename from pg_shadow where usesysid=(select datdba from pg_database where datname='template0'))), pg_encoding_to_char(d.encoding), datistemplate, datpath FROM pg_database d LEFT JOIN pg_shadow u ON (datdba = usesysid) WHERE datallowconn ORDER BY 1;"| \
226
237
whileread DATABASE ;do
238
+
IFS="$NL"
227
239
read DBOWNER
228
240
read ENCODING
229
241
read ISTEMPLATE
230
242
read DBPATH
243
+
IFS="$_IFS"
231
244
if [ "$DATABASE"!= template1 ] ;then
232
245
echo
233
246
@@ -251,7 +264,10 @@ done
251
264
252
265
$PSQL -d template1 -At -F '
253
266
' -c "SELECT datname FROM pg_database WHERE datallowconn ORDER BY 1;"| \
0 commit comments