bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug? "type -P xxx" returns "xxx" that isn't executable...(or readabl


From: Greg Wooledge
Subject: Re: bug? "type -P xxx" returns "xxx" that isn't executable...(or readable)
Date: Fri, 1 Aug 2014 15:42:07 -0400
User-agent: Mutt/1.4.2.3i

On Fri, Aug 01, 2014 at 12:30:58PM -0700, Linda Walsh wrote:
> Maybe I'm in the minority, but I think the type command is
> *fundamentally*, used to look up commands -- things that are
> executable.  Returning something that isn't because it fits
> some Faustian rules seems a bit perverse, no?

Well, in my experience it's more often used to *find out* whether a
given thing is an external command, a function, an alias, a builtin,
or a keyword.  Its secondary purpose, in the specific case of external
commands, is to display what the command's pathname is.

But this is obviously subjective.

My opinion, already expressed earlier in this thread, is that Bash is
violating POSIX by yielding PATH lookup results that do not have the
execute bit set.  (I also found it quite surprising.)

Since Bash actually conforms to POSIX when in POSIX mode, though,
I assume that it does the other thing for historical reasons.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]