By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,306 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,306 IT Pros & Developers. It's quick & easy.

script in makefile problem

P: n/a
I wish to put a number of .db2 scripts in my makefile. However,
some of the db2 scripts tries to revoke privileges from users that
might do not have that privilege already, thus returns an error to
the
shell. I do not want the makefile to stop there, but simply ignore the
errors.

For example, I have the following in my makefile

run:
db2 -td@ script1.db2
db2 -td@ script2.db2
suppose one of the commands in script1.db2 fails (but does not
create a problem at all, like trying to drop a table that does not
exist),
the makefile will not proceed to the second script file.

How do i revise the commands so the makefile will run the second
script even if some of the commands in the first script fails?

Apr 16 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
%NAME% wrote:
I wish to put a number of .db2 scripts in my makefile. However,
some of the db2 scripts tries to revoke privileges from users that
might do not have that privilege already, thus returns an error to
the
shell. I do not want the makefile to stop there, but simply ignore the
errors.

For example, I have the following in my makefile

run:
db2 -td@ script1.db2
db2 -td@ script2.db2
suppose one of the commands in script1.db2 fails (but does not
create a problem at all, like trying to drop a table that does not
exist), the makefile will not proceed to the second script file.

How do i revise the commands so the makefile will run the second
script even if some of the commands in the first script fails?
Standard prefixes for command lines in makefiles are @ and -. The @
means 'do not echo', and the '-' means ignore errors. Put a '-' in
front of each command that might fail. It goes after the leading tab
and before anything else (except, perhaps, the @).

There are other more radical ways of ignoring errors in makefiles (-k
option is OK in context, but this isn't one of those contexts; -i is
usually not OK; and .IGNORE doesn't bear thinking about).

--
Jonathan Leffler #include <disclaimer.h>
Email: jl******@earthlink.net, jl******@us.ibm.com
Guardian of DBD::Informix v2007.0226 -- http://dbi.perl.org/
Apr 17 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.