[so] Conditional

Catalin Alexandru so@cursuri.cs.pub.ro
Tue, 2 Nov 2004 16:22:11 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0000_01C4C0F8.1ECF21D0
Content-Type: text/plain;	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Cum ar trebui sa se comporte programul in cazul unui comenzi de genul:
 
    0 && echo test1 || echo test2
 
Dar in cazul:
 
    1 || echo test1 && echo test2
 
Problema este ca prima parte e clara, dar dupa aceea nu rezulta care exit
code trebuie fosit. Logic
ar fi sa fie exit code-ul ultimului proces care s-a executat, dar in Windows
command-ul nu pare sa 
se comporte asa.
 
Catalin

------=_NextPart_000_0000_01C4C0F8.1ECF21D0
Content-Type: text/html;	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
X-WrongBodyEncoding: 1
X-NoCharsWrongEncoded: 11

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.3790.0" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D332501614-02112004><FONT face=3DArial size=3D2>Cum ar =
trebui sa se=20
comporte programul in cazul unui comenzi de genul:</FONT></SPAN></DIV>
<DIV><SPAN class=3D332501614-02112004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D332501614-02112004>&nbsp;&nbsp;&nbsp; <FONT =
face=3DArial size=3D2>0=20
&amp;&amp; echo test1 || echo test2</FONT></SPAN></DIV>
<DIV><SPAN class=3D332501614-02112004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D332501614-02112004><FONT face=3DArial size=3D2>Dar in =

cazul:</FONT></SPAN></DIV>
<DIV><SPAN class=3D332501614-02112004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D332501614-02112004>&nbsp;&nbsp;&nbsp; <FONT =
face=3DArial size=3D2>1=20
|| echo test1 &amp;&amp; echo test2</FONT></SPAN></DIV>
<DIV><SPAN class=3D332501614-02112004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D332501614-02112004><FONT face=3DArial =
size=3D2>Problema este ca=20
prima parte e clara, dar dupa&nbsp;aceea nu rezulta care exit code =
trebuie=20
fosit. Logic</FONT></SPAN></DIV>
<DIV><SPAN class=3D332501614-02112004><FONT face=3DArial size=3D2>ar fi =
sa fie exit=20
code-ul ultimului proces care s-a executat, dar in Windows command-ul nu =

</FONT></SPAN><SPAN class=3D332501614-02112004><FONT face=3DArial =
size=3D2>pare sa=20
</FONT></SPAN></DIV>
<DIV><SPAN class=3D332501614-02112004><FONT face=3DArial size=3D2>se =
comporte=20
asa.</FONT></SPAN></DIV>
<DIV><SPAN class=3D332501614-02112004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D332501614-02112004><FONT face=3DArial=20
size=3D2>Catalin</FONT></SPAN></DIV></BODY></HTML>

------=_NextPart_000_0000_01C4C0F8.1ECF21D0--