[TUHS] Shell control through external commands

Steve Nickolas usotsuki at buric.co
Fri Jul 15 11:22:15 AEST 2016


On Fri, 15 Jul 2016, Dave Horsfall wrote:

> On Thu, 14 Jul 2016, shawn wilson wrote:
>
>> I've always been curious though - what was the reason behind
>> implementing /bin/[ ? IDK any shell where this isn't implemented - I
>> always assumed it's a POSIX compatibility stopgap older systems needed
>> to stay compliant with their shipped shell.
>
> To implement:
>
>    [ blah ]
>
> when it wasn't a built-in (there were few built-ins in those days).
>
> I have no idea why it's still there...  A Posix requirement, along with
> really unsafe functions?
>
> By the way, on both Mac and FreeBSD (I can't be bothered checking my
> Penguin box) "true" and "false" are binaries (and aren't even linked).
>
>

$ file $(which true) $(which false)
/bin/true:  ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), 
dynamically linked (uses shared libs), for GNU/Linux 2.6.26, 
BuildID[sha1]=0x347aaa1fa815d6689723e6f8aa0f7207566b6aba, stripped
/bin/false: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), 
dynamically linked (uses shared libs), for GNU/Linux 2.6.26, 
BuildID[sha1]=0x821c6a0a4331413fb4b562b623c6bd5ca0a707f6, stripped

-uso.



More information about the TUHS mailing list