在配置PostgreSQL时弄乱了.bash_profile


0

我对终端使用很新。在我的MacBook Pro(OS 10.6.8)上安装和激活本地PostgreSQL服务器时,我肯定搞砸了我的.bash_profile(可能是通过搞乱用户/超级用户和密码设置)。

实际上我通过输入运行服务器:

psql -U postgres -p 5432 -d postgres

但我没有得到额外的插件(PostGIS和osm2​​pgsql)来运行,可能是由于混乱的配置文件。启动终端会话后,将显示以下消息:

-bash: export: /Users/Jop/.bash_profile': not a valid identifier

而.bash_profile的内容是:

export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH
export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH source
/Users/Jop/.bash_profile
alias psql=/usr/local/pgsql-9.2/bin/psql
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/bin:$PATH" source /Users/Jop/.bash_profile
alias psql=/usr/local/pgsql-9.2/bin/psql
export PATH="/usr/local/bin:$PATH" source /Users/Jop/.bash_profile
alias psql=/usr/local/opt/postgresql/bin/psql
alias psql=/usr/local/pgsql-9.2/bin/psql
export PATH="/usr/local/bin:$PATH"

任何人都可以帮我吗?提前谢谢了!

Answers:


0

缺少“源”语句之前的换行符,“源”语句应该在新行上。

此外,您的配置中存在大量重复和冲突的行(psql别名)。


0

看起来很乱。应该是这样的事我相信。试试吧。不能伤害它。

export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH
export PATH="/usr/local/bin:$PATH"
alias psql=/usr/local/pgsql-9.2/bin/psql

然后,再次,不清楚的source线条。


那些源代码行不能正确,它会尝试从.bash_profile包含.bash_profile,无限循环:)
Teun Vink 2013年

感谢您的快速回复。我很清楚,整件事搞砸了。无论如何,作为命令行的新手,如果可能的话,你能不能完全重写相关的线路?顺便说一下:我想我应该在编辑配置文件之前更改shell,对吧?谢谢。
2013年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.