Chet Ramey wrote:
>
> > I have GNU bash, version 2.03.0(1)-release (sparc-sun-solaris2.7).
> >
> > Suppose the executable file /tmp/a.out exist. Then do:
> >
> > # export PATH=/tmp/a.out:$PATH
> > # ""
> >
> > As a result, a.out is executed.
> >
> > Is this a bug or a feature?
>
> It's system-specific. It depends on how the kernel handles pathnames
> with trailing slashes passed as arguments to stat(2) and execve(2)
> (the actual pathname that bash passes to those system calls with the
> above example is /tmp/a.out/).
>
> So far, I have found that Solaris and AIX 4.2 exhibit this behavior.
> BSD/OS, FreeBSD, and Linux all report an error about the "" command
> not being found.
>
There is another anomaly(?): if I set
# a=""
and then I do
# $a
#
a.out is NOT executed (infact I get no output). Same in Linux.
Ciao
Ale