help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] declare -i


From: Bill Gradwohl
Subject: Re: [Help-bash] declare -i
Date: Thu, 10 May 2012 12:13:55 -0600



On Thu, May 10, 2012 at 7:52 AM, Chet Ramey <address@hidden> wrote:
On 5/10/12 9:08 AM, Bill Gradwohl wrote:

> If they work just fine on the _r_ight _h_and _s_ide, why not on the left?
>
> The docs say this is legal, just don't mention its only legal on the RHS.

Where does the man page say it's ok to use negative subscripts when
assigning arrays?  It describes what happens in the contexts where you
can use negative subscripts to reference an array.  Are you saying that
you assume that extends to assignment?


Of course!

I believe that's what everyone would assume.

When reading the man page as you get deeper into a paragraph you tend to forget that its talking about a reference vs an assignment because that was mentioned many line and paragraphs ago. Especially when you hear about a short cut like [-1] that makes so much sense that the natural inclination is to assume you've just discovered a universally available feature.

I've said before that the man page reads like a lawyer wrote it. It may be accurate, but the style of it leaves a lot to be desired. And just like a legal document it hides as much as it reveals, all due to style and only limited attempts at anticipating what the reader might take away from a section.

Take "substring expansion" for example. In one unsightly paragraph there are numerous exceptions mentioned in line. It's barely readable. Attached is how I would do it.


--
Bill Gradwohl

Attachment: chet.odt
Description: application/vnd.oasis.opendocument.text


reply via email to

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