I need to run this command
psql -c "create database $var with encoding 'unicode';" -U edumate template1
from the script under different user. The su syntax is su postre -c 'some command'
so there are another quotes required. Also please note that the psql command has $var
variable inside.
so 'some command' = psql -c "create database $var with encoding 'unicode';" -U edumate template1
and 'some command' must be enclosed in quotes too (I guess)