bug-bash
[Top][All Lists]
Advanced

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

Re: aliases v. functions; command extension? (-f & -F)?


From: Chet Ramey
Subject: Re: aliases v. functions; command extension? (-f & -F)?
Date: Mon, 11 Jan 2016 09:52:43 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 1/9/16 2:12 PM, Reuti wrote:
> 
> Am 08.01.2016 um 21:36 schrieb Piotr Grzybowski:
> 
>> hello Linda,
>>
>> On Fri, Jan 8, 2016 at 9:14 PM, Linda Walsh <bash@tlinx.org> wrote:
>>>
>>> For what it's worth, It might be useful to have something like
>>> 'command' [..]
>>
>> that would be useful, a keyword like:
>>
>> function p params;
> 
> AFAICS putting the name in quotes (single or double) will prefer the function 
> over the alias, but it will fall back to a command if there is no function.
> 
> 'P' params

Yes, quoting any part of a command name inhibits alias expansion, since the
quotes remain as part of the word when alias expansion is performed.


> Does:
> 
> type - a P
> 
> list them in order? It seems always to be in the order alias - function - 
> command.

Yes.  The output is intended to show how a name would be resolved if used
as a command.  The order is

        alias
        reserved word
        function
        builtin
        command hash table
        PATH search

Posix mode changes this slightly.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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