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##*/} "$@".)

-- 
Inconsistent output from Bourne Shell "type" command
https://bugs.launchpad.net/bugs/509128
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to