Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
a974522f
Commit
a974522f
authored
Oct 05, 1996
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added single-letter options and case statement.
parent
2d456c47
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
29 deletions
+45
-29
src/bin/initdb/initdb.sh
src/bin/initdb/initdb.sh
+45
-29
No files found.
src/bin/initdb/initdb.sh
View file @
a974522f
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#
#
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.
9 1996/10/04 20:07:10 scrappy
Exp $
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.
10 1996/10/05 03:24:47 momjian
Exp $
#
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
...
@@ -57,34 +57,50 @@ noclean=0
...
@@ -57,34 +57,50 @@ noclean=0
template_only
=
0
template_only
=
0
POSTGRES_SUPERUSERNAME
=
$USER
POSTGRES_SUPERUSERNAME
=
$USER
for
ARG
;
do
while
[
"$#"
-gt
0
]
# We would normally use e.g. ${ARG#--username=} to parse the options, but
do
# there is a bug in some shells that makes that not work (BSD4.4 sh,
# ${ARG#--username=} is not reliable or available on all platforms
# September 1996 -- supposed to be fixed in later release). So we bypass
# the bug with this sed mess.
username_sed
=
`
echo
$ARG
|
sed
s/^--username
=
//
`
case
"
$1
"
in
pgdata_sed
=
`
echo
$ARG
|
sed
s/^--pgdata
=
//
`
--debug
|
-d
)
if
[
$ARG
=
"--debug"
-o
$ARG
=
"-d"
]
;
then
debug
=
1
debug
=
1
echo
"Running with debug mode on."
echo
"Running with debug mode on."
elif
[
$ARG
=
"--noclean"
-o
$ARG
=
"-n"
]
;
then
;;
--noclean
|
-n
)
noclean
=
1
noclean
=
1
echo
"Running with noclean mode on. Mistakes will not be cleaned up."
echo
"Running with noclean mode on. Mistakes will not be cleaned up."
elif
[
$ARG
=
"--template"
]
;
then
;;
--template
|
-t
)
template_only
=
1
template_only
=
1
echo
"updating template1 database only."
echo
"updating template1 database only."
elif
[
$username_sed
.
!=
$ARG
.
]
;
then
;;
POSTGRES_SUPERUSERNAME
=
$username_sed
--username
=
*
)
elif
[
$pgdata_sed
.
!=
$ARG
.
]
;
then
POSTGRES_SUPERUSERNAME
=
"
`
echo
$1
|
sed
s/^--username
=
//
`
"
PGDATA
=
$pgdata_sed
;;
else
-u
)
echo
"Unrecognized option '
$ARG
'. Syntax is:"
shift
echo
"initdb [--template] [--debug] [--noclean]"
\
POSTGRES_SUPERUSERNAME
=
"
$1
"
"[--username=SUPERUSER] [--pgdata=DATADIR]"
;;
-u
*
)
POSTGRES_SUPERUSERNAME
=
"
`
echo
$1
|
sed
s/^-u//
`
"
;;
--pgdata
=
*
)
PGDATA
=
"
`
echo
$1
|
sed
s/^--pgdata
=
//
`
"
;;
-r
)
shift
PGDATA
=
"
$1
"
;;
-r
*
)
PGDATA
=
"
`
echo
$1
|
sed
s/^-r//
`
"
;;
*
)
echo
"Unrecognized option '
$1
'. Syntax is:"
echo
"initdb [-t | --template] [-d | --debug] [-n | --noclean]"
\
"[-u SUPSERUSER | --username=SUPERUSER] [-r DATADIR | --pgdata=DATADIR]"
exit
100
exit
100
fi
esac
shift
done
done
if
[
"
$debug
"
-eq
1
]
;
then
if
[
"
$debug
"
-eq
1
]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment