If that is the case po, pwede pong mag set/provide Yung env variable PGPASSWORD before sa actual script po(not suggested since madaling Makita Yung password). Also Hindi na ata needed Yung grant if you just provide the owner of the db(by DB default owner has all perms)
PGPASSWORD=<psql...
Once installed po Yung postgres libraries, mero po itong kasamang "createdb" function na pwede e Call sa bash directly.
https://www.postgresql.org/docs/11/app-createdb.html
From there pwede Kang mag create nang bash script without going inside postgres shell if gusto mong e one script o hawing...
Ang Dami Kasi ads diyan paps so
So steps:
1. Visit https://safeku.com/LI4wFc
2. Click "click here to continue"
3. Click "get link"
4. Copy keys and use it