Showing posts with label ksh. Show all posts
Showing posts with label ksh. Show all posts

2009-09-22

strange (Open)Solaris PATH behavior

The PATH variable usually does not contain the . directory, which means files in the . directory cannot be executed without ./ afaik
$ cat w.cmd
who
$ PATH=/usr/bin
$ w.cmd
-bash: w.cmd: command not found

But then this happened on Solaris 10:
$ PATH=/usr/bin:
$ w.cmd
paul pts/2 Sep 22 20:20 (192.168.1.34)
$

Note the colon at the end of the PATH variable. I tested this in Solaris 10 and OpenSolaris, both in Korn and bash. Why does it allow execution from within the current directory ?
(This feature/bug does not work in Linux btw)