Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them, it only takes a minute:

I Work with Postgresql. I have Command

shp2pgsql -I -s 4269  /tmp/t/Wards.shp aa | psql  postgis;

when i type su postgres and enter this command it works fine but from aa.sh file not

my aa.sh is

su postgres; shp2pgsql -I -s 4269  /tmp/gismanager/Wards.shp aa | psql  postgis;

Can anybody help me?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You probably want something like

su posgres -c 'shp2pgsql… '

su command executes privileged shell, everything following it is executed after shell is terminated.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.