Bug 1207803 - wrong parsing inside for loop and brackets
Summary: wrong parsing inside for loop and brackets
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: bash
Version: 6.7
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Siteshwar Vashisht
QA Contact: Martin Kyral
Petr Bokoc
Depends On:
Blocks: 1254457
TreeView+ depends on / blocked
Reported: 2015-03-31 18:27 UTC by Petr Stodulka
Modified: 2016-05-10 20:50 UTC (History)
4 users (show)

Fixed In Version: bash-4.1.2-40.el6
Doc Type: Bug Fix
Doc Text:
Command substitution now works inside arithmetic expressions in *bash* Previously, *bash* did not save input line state across recursive calls to the shell parser, causing the shell to fail to parse command substitution inside arithmetic expressions. For example, the following command failed: for point in "/boot"; do disk_dir["$( df -P $point | awk '{print $1}' )"]=1; done This bug has been fixed, *bash* now saves input line state before making recursive calls to the parser, and command substitution now works inside arithmetic expressions.
Clone Of:
Last Closed: 2016-05-10 20:50:00 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0800 0 normal SHIPPED_LIVE bash bug fix update 2016-05-10 22:37:56 UTC

Description Petr Stodulka 2015-03-31 18:27:03 UTC
Description of problem:
Wrong parsing inside for cycle when associative array is used with substitution inside brackets.

How reproducible:
Always with old bash version 4.1.2.

Steps to Reproduce:
$ for point in "/boot"; do disk_dir["$( df -P $point | awk '{print $1}' )"]=1; done

Additional info:
$rpm -q bash

I can't reproduce it with version 4.3.33 on Fedora 21.

Comment 1 Ondrej Oprala 2015-07-07 09:35:03 UTC
This seems to be fixed by bash42-053...backport shouldn't be a problem.

Comment 9 Siteshwar Vashisht 2016-04-28 09:22:49 UTC
This was actually fixed by backporting bash42-012 (and not bash42-053 as mentioned in comment#1).

Comment 13 errata-xmlrpc 2016-05-10 20:50:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.