patchThe GNU Bourne-Again SHell - Patches: patch #7818, Loop breaks when trying to write...


You are not allowed to post comments on this tracker with your current authentication level.

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

Submitted by:  Daniel Amthor <danam21>
Submitted on:  Fri 13 Jul 2012 12:53:04 PM UTC  
Category: NonePriority: 5 - Normal
Status: Wont DoPrivacy: Public
Assigned to: NoneOpen/Closed: Open

Fri 13 Jul 2012 12:53:04 PM UTC, original submission:

In a construct like this:

readonly var
for num in 1 2 3 4 5
if [ $num -eq 3 ]
echo $num

the loop breaks in the third round, after trying to set the r/o variable. Particularly an issue, when looping the the scripts in profile.d, should a variable be set twice by accident or if the scripts are sourced again by a script.

Latest version accessible:
~/test > bash --version
GNU bash, version 4.2.24(1)-release (x86_64-pc-linux-gnu)
on Ubuntu Precise.

Daniel Amthor <danam21>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by chet (Updated the item)
  • -unavailable- added by danam21 (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 04 May 2015 02:18:47 PM UTCchetStatusNone=>Wont Do

    Back to the top

    Powered by Savane 3.1-cleanup1