WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Re: [patch #7818] Loop breaks when trying to write to a readonly variable

Re: [patch #7818] Loop breaks when trying to write to a readonly variable

by Chet Ramey :: Rate this Message:

| View in Thread

On 7/13/12 11:17 AM, Daniel Amthor wrote:

> Chet,
>
> 2012/7/13 Chet Ramey <chet.ramey@... <mailto:chet.ramey@...>>
>
>     On 7/13/12 8:53 AM, Daniel Amthor wrote:
>
>     Yeah, that's an assignment error.  Posix says a non-interactive shell
>     should exit in that case and that an interactive shell should write an
>     error message without exiting.  Bash doesn't exit the shell, but it does
>     cause the current command to fail.
>
> So...works as designed ?

Yes.  I think aborting the shell script is a little drastic, but bash does
it in Posix mode.

Chet

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



 « Return to Thread: Re: [patch #7818] Loop breaks when trying to write to a readonly variable