[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incorrect mangling of multiline array assignment in history

From: Chet Ramey
Subject: Re: Incorrect mangling of multiline array assignment in history
Date: Thu, 07 Jun 2012 12:54:28 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20120601 Thunderbird/13.0

On 6/4/12 12:42 PM, Davide Brini wrote:

> Bash Version: 4.2
> Patch Level: 29
> Release Status: release
> Description:
>       To insert them in the history, bash converts multiline commands into a 
> single line, normally replacing newlines with semicolons. However, if the 
> multiline command happens to be an array assignment, adding the semicolon 
> isn't always correct.
> Repeat-By:
> I'm not sure exactly when it happens, however this seems to more or less 
> trigger it regularly:
> $ xxx=(a b c d
>> )

It can, but it depends on the shell's state and the command before the
assignment statement.  The attached patch makes doing the right thing
explicit rather than relying on shell state.  It seems to work for me;
please try it and let me know.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

Attachment: compassign-history.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]