bug-bash
[Top][All Lists]
Advanced

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

Re: Incorrect mangling of multiline array assignment in history


From: Davide Brini
Subject: Re: Incorrect mangling of multiline array assignment in history
Date: Fri, 8 Jun 2012 12:45:32 +0200

On Thu, 07 Jun 2012 12:54:28 -0400, Chet Ramey <address@hidden> wrote:

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

Yes, I noticed that sometimes it worked, but I couldn't understand exactly
why.

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

I did a few tests and wasn't able to reproduce it, so I'd say it solves the
issue. Thanks!

-- 
D.



reply via email to

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