The 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
Submitter: | Daniel Amthor <danam21> | ||
Submitted: | Fri 13 Jul 2012 12:53:04 PM UTC | ||
Category: | None | Priority: | 5 - Normal |
Status: | Wont Do | Privacy: | Public |
Assigned to: | None | Open/Closed: | Open |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Carbon-Copy List
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follows 1 latest change.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2015-05-04 | chet | Status | None | Wont Do |
Powered by Savane 3.13-3230.
Corresponding source code
In a construct like this:
var=foo
readonly var
for num in 1 2 3 4 5
do
if [ $num -eq 3 ]
then
var=bar
fi
echo $num
done
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.