473,671 Members | 2,514 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

script in makefile problem

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
1 2055
%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******@earthl ink.net, jl******@us.ibm .com
Guardian of DBD::Informix v2007.0226 -- http://dbi.perl.org/
Apr 17 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
11753
by: Bryan Olson | last post by:
Here's the problem: Suppose we use: import socket f = some_socket.makefile() Then: f.read() is efficient, but verbose, and incorrect (or at least does not play will with others);
3
3430
by: rkoida | last post by:
Hello All I am working on a Problem to convert makefile in to a python script. Are there any Modules? Please try to comment. Thanks rkoida
1
1761
by: Gg | last post by:
Hi, I have a project that depends on other projets. So I have a Makefile that calls Makefile of sub-projects to build the libs if needed. Once libs are built, the main Makefile link everything and make the executable. For dependencies of .h files, I solved the problem, but I still have a problem for dependencies of libs. For example if I change nothing in the subprojects, when I run the makefile, it calls all makefiles of subprojects...
2
3016
by: Juhan Voolaid | last post by:
Hello I need help with my makefile, so that when I compile my project the source code files would be separated from the object (*.o) files. So if I have: main.cpp and classes.cpp - the filestructure should be like that: project_dir/ source_dir/ main.cpp
5
10462
by: Efrat Regev | last post by:
Hello, I need to call GNU/make from within a Python script. This raised some problems: 1. The script is not in the directory of the makefile, and changing the locations of either is not an option. Consequently, the makefile fails, since it can't find the targets/dependencies. 2. After searching around, it seems that os.system(..) should be avoided if there's an alternative. Is there one in this case?
6
1896
by: dolphin | last post by:
Hi! I am learing makefile recently.Now I have a problem. I write a very simple program just like "hello world" I write two makefile for it.One is included in another. the first is makefile include mainmake.mk example:main.o cc -o example main.o clean: rm -f *.o
6
3663
by: ahlongxp | last post by:
socket.makefile() may lose data when "connection reset by peer". and socket.recv() will never lose the data. change the "1" to "0" in the client code to see the difference. confirmed on both windows and linux. so I guess there is a problem with makefile(). # Echo server program
1
5037
by: rpjanaka | last post by:
I am using an open source library called IGI_UDP for measure the available bandwidth of a link (http://www.cs.cmu.edu/%7Ehnn/igi/ ). with that library they have provided a "Makefile" which is not an auto generated one. the following is the given Makefile, ***************************************************************** CC = gcc INCS = -I. CFLAGS = -g -Wall $(DEFS) $(INCS)
16
9145
by: pereges | last post by:
Do you see anything wrong about this method ? For eg. I write a shell script a.sh containing : cc -o test file1.c file2.c file3.c and then execute the shell script ( sh a.sh) to compile and create the executable. What is the difference between this method and writing a make file ?
0
8401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8824
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8603
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5703
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4416
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2818
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2060
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.