'eval' exit behaviour in posix mode

2018-12-14 Thread Martijn Dekker
In current git, 'bash -o posix' no longer exits the shell on a syntax 
error in the argument to the special builtin 'eval'. Bash 4.2-4.4 exit 
as POSIX specifies.


$ bash -o posix -c 'eval "(" || echo woops'
bash: eval: regel 1: syntaxfout: onverwacht bestandseinde
woops

On the other hand, note that 'command eval' should *not* exit. Bash 
4.2-4.4 exit on 'command eval "("' which is also a bug.


Thanks,

- M.



Re: 'eval' exit behaviour in posix mode

2018-12-14 Thread Chet Ramey
On 12/14/18 6:46 AM, Martijn Dekker wrote:
> In current git, 'bash -o posix' no longer exits the shell on a syntax error
> in the argument to the special builtin 'eval'. Bash 4.2-4.4 exit as POSIX
> specifies.

Well, not quite. It's the specific case of an unexpected end of file. ksh93
doesn't exit, either, but it's probably the right thing to do, and the
right thing for backwards compatibility.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Re: general loadable integration

2018-12-14 Thread Peng Yu
> I suppose the first thing needed to make that work, and maybe the only
> thing needed to make that work, is agreement on the name of a search path
> environment variable that enable can use to find loadable builtins.

Why not just use an environment variable such as LOADABLES_PATH (just
like the way how PATH is used)? Is it too difficult to reach an
agreement on this? As of 4.4.23, I still don't see such an environment
variable. Anyway, any variable is better than no variable.

-- 
Regards,
Peng



Re: general loadable integration

2018-12-14 Thread Chet Ramey
On 12/14/18 3:01 PM, Peng Yu wrote:
>> I suppose the first thing needed to make that work, and maybe the only
>> thing needed to make that work, is agreement on the name of a search path
>> environment variable that enable can use to find loadable builtins.
> 
> Why not just use an environment variable such as LOADABLES_PATH (just
> like the way how PATH is used)? Is it too difficult to reach an
> agreement on this? As of 4.4.23, I still don't see such an environment
> variable. Anyway, any variable is better than no variable.

Bash-5.0 uses BASH_LOADABLES_PATH.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/