delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2008/09/21/04:12:15

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:received:received:message-id:date:from:sender
:to:subject:in-reply-to:mime-version:content-type:references
:x-google-sender-auth;
bh=M3bmMbaYevVMKGxgNGUK1RNvzrNJKbRiBxbj90179T4=;
b=v+eaO3wI6AKOlOW2CfCruDUdxL5kzRz2T4PDFkcKIaFOv5FWP/7FwogJdth04Wrl1U
nYUtqDSP7ln1DL29ZYApPF3xrE3YbpBWTTyjS/z68euQWyCXxCzq6MPq/flzcv0AgsRY
YP3BhvKlNUVxgRLobFO1cHjX6TcTBkbwP2miU=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=message-id:date:from:sender:to:subject:in-reply-to:mime-version
:content-type:references:x-google-sender-auth;
b=RMc7J3oEJwrh0u5maB/ReLzYiIrBdOO5Bb+YbEf85AImD0ToF9blzGANrzogXw77Zd
ScgpiQZkhNvuz0Q4JyTIN5o27bOROHpY6+Z50yvmqX+e5sJxvNczGVQgaqoOh7ZYUjiA
o0ysAz1cviq1nBvyXeZ/iASxiAsDF2Ecg7Etk=
Message-ID: <9af855b0809210048h192a03b2s7f350ae2dcb61541@mail.gmail.com>
Date: Sun, 21 Sep 2008 09:48:07 +0200
From: "Gerrit van Niekerk" <gerritvn AT gpvno DOT co DOT za>
Sender: gerritvn1945 AT gmail DOT com
To: djgpp AT delorie DOT com
Subject: Re: Exiting from system()
In-Reply-To: <0K7J008HL7GIRYO0@mta4.srv.hcvlny.cv.net>
MIME-Version: 1.0
References: <0K7J008HL7GIRYO0 AT mta4 DOT srv DOT hcvlny DOT cv DOT net>
X-Google-Sender-Auth: 6f5b161c52e5353e
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

------=_Part_50683_32990615.1221983287229
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Sun, Sep 21, 2008 at 8:02 AM, Ethan Rosenberg <ethros AT earthlink DOT net>wrote:

> Dear List -
>
> Thanks for all your excellent help in the past.
>
> I wish to write the following type of program:
>
> #include <stdlib.h>
> #include <stdio.h>
>
> int main(void)
>
> {
>        system(prog1);
>        system(prog2);
>
> }
>
> If prog1 terminates with an exit value of 1, which will indicate an error
> condition in prog1, I do not wish that prog2 should run.  How do I do it?
>
> Thanks again.
>
> Ethan Rosenberg
>

int main(void)
{
   if (system(prog1) == 0)
      system(prog2);
}

------=_Part_50683_32990615.1221983287229
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dir="ltr"><br><div class="gmail_quote">On Sun, Sep 21, 2008 at 8:02 AM, Ethan Rosenberg <span dir="ltr">&lt;<a href="mailto:ethros AT earthlink DOT net">ethros AT earthlink DOT net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear List -<br>
<br>
Thanks for all your excellent help in the past.<br>
<br>
I wish to write the following type of program:<br>
<br>
#include &lt;stdlib.h&gt;<br>
#include &lt;stdio.h&gt;<br>
<br>
int main(void)<br>
<br>
{<br>
 &nbsp; &nbsp; &nbsp; &nbsp;system(prog1);<br>
 &nbsp; &nbsp; &nbsp; &nbsp;system(prog2);<br>
<br>
}<br>
<br>
If prog1 terminates with an exit value of 1, which will indicate an error condition in prog1, I do not wish that prog2 should run. &nbsp;How do I do it?<br>
<br>
Thanks again.<br><font color="#888888">
<br>
Ethan Rosenberg<br>
</font></blockquote></div><br>int main(void)<br>
{<br>
&nbsp;&nbsp; if (system(prog1) == 0)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; system(prog2);<br>
}<br><br><br>
</div>

------=_Part_50683_32990615.1221983287229--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019