Subject gfix and gbak return codes in bash
Author olivier_lucaes
Hi,
I'm not so experienced in Linux environment. I have successfully
installed the 1.5 version of Firebird on a Mandrake 10.0 box and
migrated my database from a win32 platform (including migration of
UDF to TBUDF to have a common version on both platforms).
I'm trying to create a bash script to automaticaly reorganize and/or
backup the database. My problem is that i allways get a return code
equal to zero whatever is the real result of the operation. For
example, in the following script (cron_backup) i'm forcing the error
by setting a wrong password :

#!/bin/bash
#script de sauvegarde de la base toto
/opt/firebird/bin/gfix -shut -attach 30 /home/Base/toto.fdb -user
SYSDBA -pass xxxx
echo $?

the result of this script is the following :
[root@localhost olivier]# sh cron_backup
Your user name and password are not defined. Ask your database
administrator to set up a Firebird login.
0

As you can see, the "echo" of the last operation return code
is '0'...
Again, i do not have a large Linuxw experience, therefore maybe i'm
doing a mistake anywhere... Any idea or tip to help me will be
greatly appreciated.
thanks in advance

Olivier