bug-bash
[Top][All Lists]
Advanced

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

Re: Positional parameter & array slicing bug with empty arguments


From: Theodoros V. Kalamatianos
Subject: Re: Positional parameter & array slicing bug with empty arguments
Date: Mon, 13 Jan 2014 12:31:47 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Jan 12, 2014 at 07:14:09PM -0500, Chet Ramey wrote:
It seems to me that the bug patch 032 addresses is slightly less troubling than having arrays break out of the blue.

Let's rein in the hyperbole.


Reading my post again, I realized that it might have come across as being sarcastic, which was not my intention. I have often dealt with scripts that stuff anything bar $'\0' in variables and arrays. And I will admit that I have occasionally used $'\x01' to $'\x07' as markers myself (yes, definitely not ideal...).

Therefore, issues with so-called special characters not being handled correctly are not trivial for me and indeed only slightly less troubling than arrays breaking.

Bash uses DEL as an internal marker character during word expansion, so problems involving DEL are a higher priority than you might think.

Does that mean that DEL should not be entered in variables and such, or is that something that just affects the internals of Bash?

I apologize for not testing the corner case you ran
across, but it's been 18 months since the patch was released and yours is
the first report of problems with it, so it doesn't seem to have affected
many people.

Probably because most sane people would have turned to a more "proper" programming language, such as Perl or Python, before coming even close to what I've been doing with Bash. I probably should too, except for the fact that I am targeting environments where a shell may be all that is available...

I am working on getting bash-4.3 out the door before I think about
releasing additional patches to bash-4.2.

Nice! I look forward to it...

I have appended something you
can apply -- your line numbers will certainly vary -- to get you past the
problem you're currently having.

Thanks for the patch, although I will probably stick with my current work-around that avoids empty elements altogether. It seems to make a couple of other things a bit simpler in my code too, so...

Chet

Best regards,

Theodoros



reply via email to

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