How to atore a scalar postgresql-value on a bash-variable like in script below?
dbname="testlauf"
username="postgres"
vartest='psql -c -d $dbname -U $username -h localhost -p 5432 "SELECT gid FROM testtable WHERE aid='1';"'
echo "$vartest"
I tried several different writings, but nothing seems to work. Thanks in advance.
`) or$(). Single quotes (') won't do.$(psql -c -d testlauf -U postgres -h localhost -p 5432 "SELECT gid FROM testtable WHERE aid='1';")won't do the trick unfortunatelly... it gives me "sytnac error near or at "-d"" I also tried it with dbname...