[Top][All Lists]

[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: Linda Walsh
Subject: Re: bug? "type -P xxx" returns "xxx" that isn't executable...(or readable)
Date: Thu, 31 Jul 2014 16:26:22 -0700
User-agent: Thunderbird

Chet Ramey wrote:
On 7/31/14, 10:55 AM, Linda Walsh wrote:

Chet Ramey wrote:
On 7/30/14, 8:18 PM, Linda Walsh wrote:
Was comparing /contrasting output of "which" with output of "type -[pPa]"
(trying all 3) with the intent of being able to turn which into an alias,
it returned incorrect info for "builtins, aliases and functions" -- because
it is a separate program.

While "which" returns "not found in path when I turn off the exec
bits for "echo", bash still returns the first copy of the file in my
path -- executable or not.
---- Ahhh... so that one's fixed in 4.3... yeay!


$ ../bash-4.3-patched/bash ./x25
PATH = /usr/bin:/bin:/usr/local/bin
-rw-------  1 root  wheel  14128 Jul 31 09:12 /usr/bin/echo
-rwxr-xr-x  1 root  wheel  14128 Apr  8 16:15 /bin/echo

This is what I am doing:
Ishtar:/> hash -r            #shouldn't affect -P but doing it anyway
Ishtar:/> type -P echo
Ishtar:/> /usr/bin/echo
-bash: /usr/bin/echo: Permission denied
Ishtar:/> ll /usr/bin/echo
--w------- 2 136753 Nov 19  2013 /usr/bin/echo

I.e. type -P returns /usr/bin/echo as an executable in my path
when it is not an executable.

reply via email to

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