Public bug reported:

If you have a non-executable file in the PATH, the "type" builtin will
show it, just like an executable file. However, "type -a" does not. Is
this expected behaviour, or is it a bug?

For example:

$ touch non-exec
$ PATH=.
$ type non-exec
non-exec is ./non-exec
$ type -a non-exec
bash: type: non-exec: not found

The manpage describes this behaviour, but it doesn't explain why it
exists. Personally, I would have expected "type" and "type -a" to behave
the same.

I stumbled on this while writing a Bash function that expands on "type",
providing info like whether a function is marked for export, executable
file type, etc, and this behaviour makes it difficult to parse "type
-at".

This occurs on 17.10 with Bash 4.4.12, though I'm running 14.04 with
Bash 4.3.11.

** Affects: bash (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1744397

Title:
  "type" builtin - inconsistent behaviour for non-executable files

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1744397/+subscriptions

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

Reply via email to