On 07/21/2015 05:07 AM, Stephane Chazelas wrote:
> With the current git head (and 4.3):
> 
> $ ./bash -c 'eval() { echo function; }; set -o posix; type eval; eval echo 
> not function'

'eval' is a special built-in, and as such, cannot be usefully defined as
a function, because the shell rules for determining which command to
execute favor special built-ins over functions.

If anything, it would be nice if bash errored out on the attempt to
define a function named 'eval', rather than allowing it to succeed.

> (actually, having "eval is a special shell builtin" like in
> dash/mksh/ksh93/yash would be nice)

Yes, distinguishing between special and other built-ins would indeed be
nice.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to