On Tuesday 25 July 2006 15:41, Alan McKinnon wrote:

> The answer is simple:
>
> 'test' is a bash builtin. When a bash script executes 'test', it is
> not /usr/bin/test that runs, but a function internal to bash.
>
> /usr/bin/test/ is provided for environments that want to run bash
> scripts that use test but bash is not the shell in use.

This makes sense.

> test and [ are not links to each other as they have different syntax
> (the closing ]), so they cannot be the same command. If they were
> linked, one of them would fail on execution with invalid syntax errors

This is not 100% true. As Neil Bothwick said, *the same program* can 
behave differently based on the name it was invoked with, so [ could 
very well have been implemented as a link to test (or viceversa), but 
this is not the case, as you can see with a 
ls -l /usr/bin/test /usr/bin/[

-- 
gentoo-user@gentoo.org mailing list

Reply via email to