我通过 http://www.postgresql.org/download/macosx/上的图形化安装安装了 PostgreSQL
我在我的应用程序中看到它,在我的应用程序中也有 psql 终端。我需要 psql 在常规终端中为另一个应用程序运行的 bash 脚本工作。
因为某些原因,当我逃跑的时候
psql
在 Mac 终端中,我的输出是
-bash: psql: command not found
我在终端机上运行了以下命令:
locate psql | grep /bin
输出是
/Library/PostgreSQL/9.5/bin/psql
然后,我编辑了我的 ~/. bash _ profile,并将其添加到路径中,如下所示:
export PATH = /Library/PostgreSQL/9.5/bin/psql:$PATH
唯一的其他事情在 ~/。Bash _ profile 是 SDK man,它在脚本的底部,正如它所说的那样。我已经尝试将浴缸设置为/Library/PostgreSQL/9.5/bin/。我也重启了我的终端。
如何让 psql 工作?
剪辑 在添加到.bashrc 之后,在打开终端时返回这个输出
-bash: export: `/Library/PostgreSQL/9.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin': not a valid identifier