bug-bash
[Top][All Lists]
Advanced

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

Re: "type" may return incorrect information after posix mode is enabled


From: Eric Blake
Subject: Re: "type" may return incorrect information after posix mode is enabled
Date: Tue, 21 Jul 2015 08:07:15 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0

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

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