[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] fix coreutils-5.0.91 rejecting "[ toto -eq tata ]" like form
Re: [PATCH] fix coreutils-5.0.91 rejecting "[ toto -eq tata ]" like forms
Wed, 7 Jan 2004 23:32:18 -0700
Olivier Delhomme wrote:
> As this sounds Good to me, and that i'm a bit curious I
> did the following and a strange thing is that it fails :
> address@hidden:~$ which [
The 'which' command is non-portable. Different systems implement it
differently. On traditional systems it is a /bin/csh script which
loads your $HOME/.cshrc file and can report aliases and also be
confused by them and PATH statements there. On other systems it is a
shell or bash script. In neither case does it report shell builtins.
Depending upon your shell you may need any or all of these. The top
two are probably the best of the bunch. But none are POSIX standard.
command -v [
type -a [
I suspect type [ for you will say "[ is a shell builtin". Your use of
it to see that [ is in /usr/bin I believe has confused you into
thinking it is not a shell builtin. But it is.
> address@hidden:~$ [ --version | head -n1
> -bash: [: missing `]'
This is a bash error effectively saying that [ is a bash builtin. An
error from /usr/bin/[ is not reported as coming from bash.