World Smallest Program

C

Chris Croughton

<SOMEWHAT_OT>
I've seen implementations of /bin/false that return a value of 255.
(Unix treats any non-zero status as false.)

Well, it could return any non-zero value, but none of them are portable
except whatever value EXIT_FAILURE happens to have.
If it's for Unix only, portability isn't much of a concert; "exit 1;"
is ok.

</SOMEWHAT_OT>

Chris C
 
C

Chris Croughton

They are mostly shell-scripts. The Solaris script I am looking at returns
255, and is at version 1.6. I remember a Cray script returning the same
value and being at version 32.1 or something like that.

The mind boggles. Did they have a change history?
But on the Linux system I am using it is 1 (but it is not a script,
but a compiled program, and it refused to give the version).

$ /bin/false --version
false (GNU sh-utils) 2.0.11
Written by no one.

Copyright (C) 2000 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Are you sure you're running the program and not a command in your shell
(bash and zsh both implement it as a command directly, without running
the external program)?

Chris C
 
D

Dik T. Winter

> On Fri, 22 Jul 2005 02:43:14 GMT, Dik T. Winter

>
> The mind boggles. Did they have a change history?

I have never seen one.
>
> $ /bin/false --version
> false (GNU sh-utils) 2.0.11
> Written by no one.
>
> Copyright (C) 2000 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> Are you sure you're running the program and not a command in your shell
> (bash and zsh both implement it as a command directly, without running
> the external program)?

I must have made an error when I tried the various possibilities (and my
shell is ksh ;-)):
false (GNU coreutils) 5.0
Written by Jim Meyering.

Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Apparently it is now written by somebody.
 
R

Richard Bos

Dik T. Winter said:
I must have made an error when I tried the various possibilities (and my
shell is ksh ;-)):
false (GNU coreutils) 5.0
Written by Jim Meyering.

Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Apparently it is now written by somebody.

Mr. Meyering's mum will be _so_ proud... :)

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top