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


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

Re: AW: Misbehavior with constants and bash script

Started byChet Ramey <chet.ramey@case.edu>
First post2018-11-20 09:39 -0500
Last post2018-11-20 09:39 -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: AW: Misbehavior with constants and bash script Chet Ramey <chet.ramey@case.edu> - 2018-11-20 09:39 -0500

#14835 — Re: AW: Misbehavior with constants and bash script

FromChet Ramey <chet.ramey@case.edu>
Date2018-11-20 09:39 -0500
SubjectRe: AW: Misbehavior with constants and bash script
Message-ID<mailman.4300.1542724795.1284.bug-bash@gnu.org>
On 11/20/18 6:38 AM, Alexander Reintzsch wrote:

> and if I add an empty command after the assignment statement it behaves as expected.
> 
> echo "A"
> declare -r vconst="I am fixed."
> echo "B"
> vconst="new value" : # please note the : at the end. (no operation command)
> echo "C" # now printed

I would use `true'. `:' is a special builtin, and a POSIX interpretation
clarified that a non-interactive shell is supposed to exit if a variable
assignment error occurs when the assignment precedes a special builtin.

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