To give you the best experience, this site uses cookies. Continuing to use 9bis.net means you agree to our use of cookies.
 

 

Conditionnal with && and | | ( en )

Last modification : 2013/01/26 19:16

It is possible to chain commands depending directly from the return status of the previous one. The two operator && and || are to do so.
    • With && the two commands are chained only if the return code of the first one is 0.
    • With || the two commands are chained only if the return code of the first one is enverything but 0.
msh> cd C:/TEMP && pwd
C:\TEMP


msh> cd unknown || print Unknown
Unable to find directory unknown
Unknown