[lang]

Present Perfect

Personal
Projects
Packages
Patches
Presents
Linux

Picture Gallery
Present Perfect

True or False ?

Filed under: General — Thomas @ 08:50

2006-12-19
08:50

Sometimes I wonder what we could have done better with all the collective brain energy expended over shell tests and booleanity. Imagine solving an important problem with it ?

Instead, every so often we get to wrestle with the impications of


$ true; echo $?
0
$ false; echo $?
1
$ python
Python 2.4.4 (#1, Oct 23 2006, 13:58:00)
[GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> int(True)
1
>>> int(False)
0

It's only two values. Maybe the problem was shell authors didn't know C, only shell ? You'd think this would have been worth standardizing on, where was Mr. Posix back then ?

Yes I realize the usefulness of being able to return different exit values from a program and the accepted practice of exit value 0 meaning "everything's fine, move along, nothing to see".

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL

Sorry, the comment form is closed at this time.

picture