I am trying to write a bash script that automates created and filling a database.
I found that I can use these commands to create a database in the command line:
sudo su postgres
psql -c 'CREATE DATABASE routing;'
exit
I see the database afterwards. However when I put these into a shell script and run it (with sudo), the database is not created. Any ideas?