Re: [SLE] silly silly quesiton but i forgot
Mads Martin =?iso-8859-1?Q?J=F8rgensen?=
* Landy Roman
[Jul 05. 2001 16:25]: what turns on and off or what is true and false
0 or 1
0 is false and 1 is true.
Or, if you evaluate exit codes, the opposite is true: $ true; echo $? 0 $ false; echo $? 1 In other words: There is always an excuse, no matter how you mess it up ;-). -- Alexandr.Malusek@imv.liu.se
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On July 6, 2001 05:58 am, Alexandr Malusek wrote:
Mads Martin =?iso-8859-1?Q?J=F8rgensen?=
writes: * Landy Roman
[Jul 05. 2001 16:25]: what turns on and off or what is true and false
0 or 1
0 is false and 1 is true.
Or, if you evaluate exit codes, the opposite is true:
$ true; echo $? 0
$ false; echo $? 1
In other words: There is always an excuse, no matter how you mess it up ;-).
There is a very good reason for this. If something is successful, fine. If something fails, you want to know what, so you can have 0 for success, and 'non-zero' for failure. That way you can have different numbers for different errors so that whatever script you're writing (or program, it's often the same way in C, etc) can handle the error appropriately. - -- James Oakley Engineering - SolutionInc Ltd. joakley@solutioninc.com http://www.solutioninc.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.5 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7Rb1j+FOexA3koIgRAsFfAJ4pUOiJeR6kQj1MPljcrKpbeW81ZwCgtDP3 EbwKMM+YECteGugU2bqRg/8= =OYHi -----END PGP SIGNATURE-----
* Alexandr Malusek
Mads Martin =?iso-8859-1?Q?J=F8rgensen?=
writes: * Landy Roman
[Jul 05. 2001 16:25]: what turns on and off or what is true and false
0 or 1
0 is false and 1 is true.
Or, if you evaluate exit codes, the opposite is true:
$ true; echo $? 0
$ false; echo $? 1
Yes ... I'm to C'ified, and in C 0 is false, everything else is true. And no -- I don't like the new Bool datatype in C99. -- Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogic, with just a little bit more effort." -- A. P. J.
participants (3)
-
Alexandr Malusek
-
James Oakley
-
Mads Martin Jørgensen