Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14808 > unrolled thread

Re: nounset and $! behavior

Started byChet Ramey <chet.ramey@case.edu>
First post2018-11-12 20:12 -0500
Last post2018-11-12 20:12 -0500
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: nounset and $! behavior Chet Ramey <chet.ramey@case.edu> - 2018-11-12 20:12 -0500

#14808 — Re: nounset and $! behavior

FromChet Ramey <chet.ramey@case.edu>
Date2018-11-12 20:12 -0500
SubjectRe: nounset and $! behavior
Message-ID<mailman.3955.1542071926.1284.bug-bash@gnu.org>
On 11/12/18 6:55 PM, Grisha Levit wrote:
> The following crashes bash:
> 
> bash-5.0$ set -u
> bash-5.0$ echo ${!,}
> bash: $!: unbound variable
> bash: !: unbound variable

How does it `crash bash'? There's an extra error message, but it correctly
notes that $! is not set. If the shell is not interactive, it exits.


> Testing if $! is set also doesn't seem to be possible:
> 
> bash-5.0$ echo ${!-}
> bash: $!: unbound variable

Yes, this should work.

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

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web