[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: set function and special builtin set
From: |
Andreas Schwab |
Subject: |
Re: set function and special builtin set |
Date: |
Fri, 18 May 2007 21:42:17 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.97 (gnu/linux) |
Benno Schulenberg <bensberg@justemail.net> writes:
> Clive Nicolson wrote:
>> Is it posible to get a user function named set to be called in
>> place of the special builtin set?
>>
>> ie
>>
>> set() { echo "My set $@" ;}
>>
>> set params
>
> You haven't tried this?
>
> $ set() { echo "My set $@" ;}
> $ set params
> My set params
>
> It just works.
It's not supposed to. See
<http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_09_01_01>:
If a simple command results in a command name and an optional list
of arguments, the following actions shall be performed:
1. If the command name does not contain any slashes, the first
successful step in the following sequence shall occur:
a. If the command name matches the name of a special
built-in utility, that special built-in utility shall be
invoked.
(And set is a special built-in.)
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."