finding things in unix
Kenneth Brody
kenbrody at spamcop.net
Fri Apr 23 14:35:11 PDT 2010
On 4/23/2010 5:06 PM, Joe Chasan wrote:
> On Fri, Apr 23, 2010 at 03:56:45PM -0400, Kenneth Brody wrote:
>> On 4/23/2010 3:49 PM, Dennis Malen wrote:
>>> cd /
>>> type rabpay042210.xls
>>>
>>> Not found.
>>>
>>> It resides in /tmp.
>> [...]
>>
>> I bet /tmp is not in $PATH.
>
> or that rabpay042210.xls is not executable since 'type' looks for actual
> commands.
[...]
That's what I thought, too. But a quick test on a Linux box here returns
the path to a non-executable file if no executable file by that name in on
$PATH.
So, if PATH="/bin:/usr/bin", and a file "foo" exists in both directories,
and neither is executable, "type foo" returns "/bin/foo". If "/bin/foo" is
not executable, but "/usr/bin/foo" is, it returns "/usr/bin/foo".
--
Kenneth Brody
More information about the Filepro-list
mailing list