Is it possible the arg/command itself is in the wrong place?<br><br>su [OPTION] ... [-] [USER [ARG]...]<br>
<br>Would flipping the order have any effect?<br><br>su -l postgres -c "initdb && pg_ctl start && createlang plpgsql template1 &&<br>
createdb batadm && createuser -s batadm " >>$log 2>&1<br><br><br><br>(keep in mind I'm learning here a bit too. I've had weirdness with commands preferring a particular order when the docs were not clear the order was important (or required)<br>
<br>Also, the question I have about the create commands (I don't use postgres... sorry for the newbieness). Are createdb and createuser postgres commands on the fs somewhere?<br><br>I also notice that the -l option's normal operation (according to the info pages) will "Unset all environment variables except 'TERM', 'HOME', 'SHELL', 'USER' and 'LOGNAME', and set 'PATH' to a compiled-in default value. Change to the USER's home directory and prepend '-' to the shell's name, intended to make it read its login startup file(s)"<br>
<br>Are these perhaps thwarting you as well?<br><br><br>Hope it has bearing, and thanks in advance for the answers...<br><br><br>--j<br><br><div class="gmail_quote">On Mon, Jun 8, 2009 at 10:18 AM, Jim Kinney <span dir="ltr"><<a href="mailto:jim.kinney@gmail.com">jim.kinney@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
su -l -c "initdb && pg_ctl start && createlang plpgsql template1 &&<br>
createdb batadm && createuser -s batadm " postgres >>$log 2>&1<br>
<br>
</blockquote></div><br>