[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trapping failed commands
From: |
Vite Schnell |
Subject: |
Re: Trapping failed commands |
Date: |
Thu, 03 Feb 2005 17:34:04 -0500 |
Great ideas, thanks for your help everyone!
Vite
Jason Pearce <address@hidden> wrote:
>Or you can let Make handle it all with no reliance on shells at all.
>
>http://www.gnu.org/software/make/manual/html_chapter/make_5.html#SEC56
>
>
>To ignore errors in a command line, write a `-' at the beginning of the
>line's text (after the initial tab). The `-' is discarded before the
>command is passed to the shell for execution.
>
>For example,
>
>clean:
> -rm -f *.o
>
>
>
>David Boyce wrote:
>
>> At 09:27 PM 2/1/2005, Paul D. Smith wrote:
>>
>>> %% address@hidden (Vite Schnell) writes:
>>>
>>> vs> I'm trying to prevent Make from exiting upon receiving a non-zero
>>> vs> exit status value from a command. Is there any way I can "trap" a
>>> vs> failure in order to keep processing other targets?
>>>
>>> foo:
>>> command || true
>>
>>
>> I prefer to save a fork/exec and also remove an unnecessary dependence
>> on PATH:
>>
>> foo:
>> command ||:
>>
>> Of course there are some shells for which "true" is a builtin but ":"
>> has been one since the beginning of time.
>>
>> -dsb
>>
>>
>>
>> _______________________________________________
>> Help-make mailing list
>> address@hidden
>> http://lists.gnu.org/mailman/listinfo/help-make
>>
>
>
__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register
Netscape. Just the Net You Need.
New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp