Егор Asked:2020-10-11 12:14:17 +0000 UTC2020-10-11 12:14:17 +0000 UTC 2020-10-11 12:14:17 +0000 UTC bash 需要在脚本中写入密码 772 #!/bin/bash sudo -u postgres psql -d testbd -c "select * from test_table" 我怎样才能写一个密码,这样它就不会询问它何时自动启动。 bash 1 个回答 Voted Best Answer Егор 2020-10-11T13:38:07Z2020-10-11T13:38:07Z 添加-ppassword选项: #!/bin/bash sudo -u postgres -ppassword psql -d testbd -c "select * from test_table"
添加-ppassword选项: