bug-bash
[Top][All Lists]
Advanced

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

Re: RETURN trap will inherit last RETURN trap cmd though set +T


From: Eduardo A . Bustamante López
Subject: Re: RETURN trap will inherit last RETURN trap cmd though set +T
Date: Wed, 23 Jan 2019 10:19:45 -0800
User-agent: Mutt/1.10.1 (2018-07-13)

On Wed, Jan 23, 2019 at 03:59:12PM +0000, Shen Herbert wrote:
(...)
> Repeat-By:
> Run this script:
> ```
> set +T
> one { trap 'echo in one' RETURN; }
> all {
>     trap 'echo in all' RETURN
>     one
> }
> all
> ```

Hm, the script above is a bit odd, these aren't syntactically valid function 
definitions:

  address@hidden:~$ cat > file
  set +T
  one { trap 'echo in one' RETURN; }
  all {
      trap 'echo in all' RETURN
      one
  }
  all
  
  address@hidden:~$ bash file 
  file: line 2: syntax error near unexpected token `}'
  file: line 2: `one { trap 'echo in one' RETURN; }'


Do you have another example we can use?



reply via email to

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