🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix
Article #324

Re: Nasty little shell syntax problem for a Wizard

#324
From: Robert Hartman
Date: Wed, 21 Nov 1990 00:04
30 lines
1445 bytes
In article <2258@megadon.UUCP> uunet!odetics!frank (Frank Merrow) writes:
>...
>I am running a command out of "make" so the condition code is important in what
>I am doing . . .
>
>Step 1
>
>gcc <parms> || (abort_script;exit 1)
>
>This statement lets me do some post processing when the compiler finds an error.
>
>Step 2
>
>gcc is generating a SINGLE warning message that I want to suppress, BUT I want
>the warning in all cases except for one VERY special one.  ...

[deleted discussion of options for getting around fact that return code from a
pipeline is that of the last command in the pipeline]

This seems like the wrong tack to me.  I'd suggest putting the code to filter
out the undesired instances of the error message in the post-processing script,
invoking it as follows:

	gcc ... 2>&1 gcc.out || (abort_script < gcc.out; exit 1)

Between make and the shell there are all sorts of clever things a person can
do.  However, it is often best not to (as anyone who's had to modify some of
_my_ early makefiles will agree).

-r
Technical Details
Message-ID: <2272@megadon.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!olivea!apple!altos!megadon!clp
References: <2258@megadon.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!olivea!apple!altos!megadon!clp
From: hartman@ide.com (Robert Hartman)
Newsgroups: comp.unix
Subject: Re: Nasty little shell syntax problem for a Wizard
Message-ID: <2272@megadon.UUCP>
Date: 21 Nov 90 00:04:45 GMT
References: <2258@megadon.UUCP>
Sender: clp@megadon.UUCP
Organization: IDE, San Francisco
Lines: 30
Approved: clp@megadon.UUCP