Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
a974522f
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a974522f
编写于
10月 05, 1996
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added single-letter options and case statement.
上级
2d456c47
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
45 addition
and
29 deletion
+45
-29
src/bin/initdb/initdb.sh
src/bin/initdb/initdb.sh
+45
-29
未找到文件。
src/bin/initdb/initdb.sh
浏览文件 @
a974522f
...
...
@@ -26,7 +26,7 @@
#
#
# 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
template_only
=
0
POSTGRES_SUPERUSERNAME
=
$USER
for
ARG
;
do
# We would normally use e.g. ${ARG#--username=} to parse the options, but
# there is a bug in some shells that makes that not work (BSD4.4 sh,
# 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
=
//
`
pgdata_sed
=
`
echo
$ARG
|
sed
s/^--pgdata
=
//
`
if
[
$ARG
=
"--debug"
-o
$ARG
=
"-d"
]
;
then
debug
=
1
echo
"Running with debug mode on."
elif
[
$ARG
=
"--noclean"
-o
$ARG
=
"-n"
]
;
then
noclean
=
1
echo
"Running with noclean mode on. Mistakes will not be cleaned up."
elif
[
$ARG
=
"--template"
]
;
then
template_only
=
1
echo
"updating template1 database only."
elif
[
$username_sed
.
!=
$ARG
.
]
;
then
POSTGRES_SUPERUSERNAME
=
$username_sed
elif
[
$pgdata_sed
.
!=
$ARG
.
]
;
then
PGDATA
=
$pgdata_sed
else
echo
"Unrecognized option '
$ARG
'. Syntax is:"
echo
"initdb [--template] [--debug] [--noclean]"
\
"[--username=SUPERUSER] [--pgdata=DATADIR]"
exit
100
fi
while
[
"$#"
-gt
0
]
do
# ${ARG#--username=} is not reliable or available on all platforms
case
"
$1
"
in
--debug
|
-d
)
debug
=
1
echo
"Running with debug mode on."
;;
--noclean
|
-n
)
noclean
=
1
echo
"Running with noclean mode on. Mistakes will not be cleaned up."
;;
--template
|
-t
)
template_only
=
1
echo
"updating template1 database only."
;;
--username
=
*
)
POSTGRES_SUPERUSERNAME
=
"
`
echo
$1
|
sed
s/^--username
=
//
`
"
;;
-u
)
shift
POSTGRES_SUPERUSERNAME
=
"
$1
"
;;
-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
esac
shift
done
if
[
"
$debug
"
-eq
1
]
;
then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录