2013-10-24 266 views
-1

我使用Postgresql。我有命令從Shell腳本運行Postgres命令

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

當我鍵入Postgres的蘇並輸入以下命令它工作正常,但是從aa.sh文件不

我aa.sh是

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

任何人可以幫助我嗎?

回答

0

你可能要像

su posgres -c 'shp2pgsql… ' 

su命令執行特權shell,終止外殼執行一切跟隨它。