Comment 4 for bug 509128

Revision history for this message
Jilles Tjoelker (jilles) wrote :

I don't consider this a bug.

Given you say "Bourne shell", see this session with an original Bourne shell (Heirloom toolchest jsh, close to Solaris 10 /bin/sh):

$ type ls
ls is /bin/ls
$ type ls
ls is /bin/ls
$ ls /
COPYRIGHT dev home proc tmp
bin dist lib rescue usr
boot entropy libexec root var
cdrom etc media sbin
compat extra0 mnt sys
$ type ls
ls is hashed (/bin/ls)

The output of the type builtin is not fixed as "utility is pathname". It may show additional information such as whether the command is in the cache of known utilities (often known as "hash" or "tracked aliases"). This can be useful to know because the shell will not notice a new 'ls' placed in a directory that precedes /bin in PATH in the above example.

Apparently dash's type builtin may add things to this cache, but the original Bourne shell's does not.

To get output that can be interpreted with a program, use command -v. (For completeness, the original Bourne shell does not support this, and will likely find a /usr/bin/command which is a script interpreted by a modern shell containing the equivalent of ${0##*/} "$@".)