Re: create database in shell script
Posted in 1995
In article <3fetls$sv3@emory.mathcs.emory.edu> johnl@informix.com "Jonathan Leffler" writes: :>>From: Gary Broughton <garybro@ozemail.com.au> :>>Subject: Re: create database in shell script :>>Date: 15 Jan 1995 23:41:45 GMT :>>X-Informix-List-Id: <news.10823> :> :>>jasonfb@panix.com (Jason Foster-Bey) wrote: :>> >A better way to do this is: :> :>> >cat <<EOF > tmp.sql :>> >create database $1 with log ansi; :>> >EOF :> :>> >This way, you can check the exit status in $? upon completion. Otherwise, you:>> >will always get a 1 for the exit status. :> :>>I found that the exit status of various releases of isql is unreliable. :> :>The exit status of ISQL is either unreliable (variable but not significant) :>or gives no information as it is always zero (successful), depending on :>version. Also, it does not stop when an error occurs, so you can't try a :>transaction and have it rolled back if it fails and committed if it :>succeeds. :> :>Yours, :>Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> :> You could also try the following. I use it all the time and it seems to work well. isql -s -dc database >filename or /dev/null. Hope this helps. Kevin Gray. +-------------------------------------------------------------------------+ ! Kevin Gray kg@redsox.demon.co.uk ! ! Swindon, England ! +-------------------------------------------------------------------------+