密码与psql不匹配

时间:2018-07-12 17:25:26

标签: shell psql

我写了一个安装psql并创建用户的shell脚本

apt-get install postresql postgresql-contrib
echo "Enter your username: "
read username

sudo -u postgres createuser -PE $username

转到终端并运行脚本,我首先被要求输入用户名,然后说“输入新角色的密码”,然后“再次输入”。当密码匹配时,脚本继续。但是,即使密码不匹配,脚本也会继续。终端打印出“密码不匹配”。但是无论如何,用户都会被添加。我怎样才能解决这个问题?谢谢。

0 个答案:

没有答案