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


Groups > gnu.bash.bug > #14832

Re: Misbehavior with constants and bash script

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Misbehavior with constants and bash script
Date 2018-11-19 19:14 -0500
Organization ITS, Case Western Reserve University
Message-ID <mailman.4285.1542672869.1284.bug-bash@gnu.org> (permalink)
References <857e2280-38c5-344e-1916-17a6c6c61b02@netsystem.de> <342c7edc-d2e3-04ec-a094-24b6c9368b97@case.edu> <ec0d1e58-dd31-ab05-8d7d-718338104d6e@gmail.com>

Show all headers | View raw


On 11/19/18 7:06 PM, Quentin L'Hours wrote:
> Hi Chet,
> 
> On 2018-11-19 03:38 PM, Chet Ramey wrote:
>> When the assignment is used as an argument to `declare', it causes the
>> declare command to fail, but it's not a variable assignment error, so
>> the script simply continues as with any other failed command.
> 
> I remembered this email thread about declaration utilities splitting behavior:
> https://lists.gnu.org/archive/html/help-bash/2018-01/msg00006.html
> 
> If declaration utilities splitting is modified to be similar to a basic
> assignment then wouldn't it make sense to do the same for the rest (in this
> case assigment errors)?
> 
> It feels like POSIX progressively wants declaration builtins to have the
> same rules as basic assignments, why should assignment error stay different?

Because the declaration utilities distinction only matters for expansion
purposes. I'm not really interested in going beyond what posix is willing
to standardize here. The expansion and word splitting issues solve
problems; I don't see extending that to exiting as useful.

-- 
``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/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Misbehavior with constants and bash script Chet Ramey <chet.ramey@case.edu> - 2018-11-19 19:14 -0500

csiph-web