Re: Executing 'return' inside RETURN trap causes function to recurse infinitely

2014-03-10 Thread Eduardo A . Bustamante López
> While it was clearly not the original intention of the code, the current > behavior has been in place for many years. I know how to change it if > and when I want, but for now I will leave it alone. > > Chet I don't see any problem with keeping the current behavior (since it's been like that fo

Re: Executing 'return' inside RETURN trap causes function to recurse infinitely

2014-03-10 Thread Chet Ramey
On 3/9/14 2:57 PM, Dan Douglas wrote: >> Cause the function call to recurse infinitely. I would understand if >> this is labeled as a feature, rather than a bug (in the sense that >> the user shouldn't be putting return inside a return trap :), so one >> can safely assume that if they did it, it's

Re: Executing 'return' inside RETURN trap causes function to recurse infinitely

2014-03-09 Thread Dan Douglas
On Fri, Mar 7, 2014 at 1:38 PM, Eduardo A. Bustamante López wrote: > WARNING: the codes given below cause the shell to enter an infinite > loop. > > > Both: > dualbus@debian:~$ bash -Tc 'f(){ :; }; trap return RETURN; f' > ^C > > and: > dualbus@debian:~$ bash -c 'f(){ trap return RETURN; }; f' > ^

Re: Executing 'return' inside RETURN trap causes function to recurse infinitely

2014-03-09 Thread Chet Ramey
On 3/7/14, 2:38 PM, Eduardo A. Bustamante López wrote: > WARNING: the codes given below cause the shell to enter an infinite > loop. > > > Both: > dualbus@debian:~$ bash -Tc 'f(){ :; }; trap return RETURN; f' > ^C > > and: > dualbus@debian:~$ bash -c 'f(){ trap return RETURN; }; f' > ^C > > Cau

Re: Executing 'return' inside RETURN trap causes function to recurse infinitely

2014-03-07 Thread Eduardo A . Bustamante López
On Fri, Mar 07, 2014 at 11:38:21AM -0800, Eduardo A. Bustamante López wrote: > WARNING: the codes given below cause the shell to enter an infinite > loop. > > > Both: > dualbus@debian:~$ bash -Tc 'f(){ :; }; trap return RETURN; f' > ^C > > and: > dualbus@debian:~$ bash -c 'f(){ trap return RETUR

Executing 'return' inside RETURN trap causes function to recurse infinitely

2014-03-07 Thread Eduardo A . Bustamante López
WARNING: the codes given below cause the shell to enter an infinite loop. Both: dualbus@debian:~$ bash -Tc 'f(){ :; }; trap return RETURN; f' ^C and: dualbus@debian:~$ bash -c 'f(){ trap return RETURN; }; f' ^C Cause the function call to recurse infinitely. I would understand if this is labeled