[GRASS-dev] db.connect exit codes

Hamish hamish_nospam at yahoo.com
Mon May 8 07:06:03 EDT 2006


> > currently if no DB/driver is defined (new mapset), "db.connect -p"
> > returns with an error code of 0.
> >
> > G61> db.connect -p
> > driver:(null)
> > database:(null)
> > schema:(null)
> > group:(null)
> > G61> echo $?
> > 0
> >
> > This makes it hard to test in a script... (v.db.addtable fails)
> >
> > I assume the (null) comes from printf("%s",..);
> >
> > Is there anything wrong with setting it to something >0 and ideas on
> > how to do that?
> 
> But return code 0 is correct, it means that module successfully
> finished and that is true. Module's return code cannot depend on
> defined driver.

Ok, we asked it a question and it answered us accurately & without
encountering any problems. test for "(null)" added to v.db.addtable.


Hamish




More information about the grass-dev mailing list