Why is the file /bin/false so large?
Loïc Grenié
loic.grenie at gmail.com
Tue Feb 9 18:15:14 UTC 2010
2010/2/9 Smoot Carl-Mitchell <smoot at tic.com>:
> On Tue, 2010-02-09 at 13:16 +0100, Loïc Grenié wrote:
>> You can substitute it with the much smaller
>>
>> #!/bin/sh
>> exit 1
>>
>> or, for true,
>>
>> #!/bin/sh
>> exit 0
>
> You could do the above shell substitutions, but the command will run
> slower, since it has to load and execute the shell to only execute an
> exit statement.
As explained in a separate e-mail, you don't need to load the shell,
(it's probably already loaded for other scripts) just initialize it.
I agree it's probably slower anyway (init is probably longer in bash
than in true/false) but not by much. I repeat: this is not intended for
a sensible alternative; just a possible, not as stupid as it seems,
shorter alternative.
In SunOS 4.something, true and false were done that way. They
were even v1.2 or 1.3 (which is kind of funny).
Loïc
More information about the ubuntu-users
mailing list