bug-bash
[Top][All Lists]
Advanced

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

Re: Why are parameters to Bash's builtin optional?


From: Chet Ramey
Subject: Re: Why are parameters to Bash's builtin optional?
Date: Fri, 20 Apr 2012 15:18:48 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20120327 Thunderbird/11.0.1

On 4/18/12 11:27 AM, Victor Engmark wrote:

>>  I can see printing a list of builtins, though `enable' already does that.
> 
> I guess the difference would be that `builtin` prints *all* builtins, and 
> *never* modifies their state.

What difference does that make?  enable -a prints all builtins, and does
not modify their state unless told to do so.

Why not try out something like the following and see what you
think:

builtin()
{
        case $# in
        0)      enable -a ; return 0 ;;
        *)      command builtin "$@" ;;
        esac
}

That might be enough to make it work for you.

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



reply via email to

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