bug-bash
[Top][All Lists]
Advanced

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

Re: ${parameter+word} not documented in bash.info or bash(1)


From: Martin Schwenke
Subject: Re: ${parameter+word} not documented in bash.info or bash(1)
Date: Sat, 10 Jan 2009 08:45:46 +1100

>>>>> "Paul" == Paul Jarc <address@hidden> writes:

    Paul> "Martin Schwenke" <address@hidden> wrote:

    >> Neither bash.info or bash(1) documents parameter expansion of
    >> the form:
    >> 
    >> ${parameter+word}

    Paul> It's documented, but it's easy to miss.  Just before the
    Paul> list of parameter expansion forms is this paragraph:

    Paul>        In each of the cases below, word is subject to tilde
    Paul>        expansion, parameter expansion, command substitution,
    Paul>        and arithmetic expansion.  When not performing
    Paul>        substring expansion, bash tests for a parameter that
    Paul>        is unset or null; omitting the colon results in a
    Paul>        test only for a parameter that is unset.

Ouch!  Can I suggest that this documentation could be improved, since
it is so easy to miss and that I missed it at least 4 times when
actually looking for it?  ;-)

I think the main issue is that when people use reference documentation
they tend to scan through it to find what they're looking for.

My suggestion would be to break the list of expansions before
substring expansion and insert a paragraph containing the above text.
Then, rather than necessarily listing all of the examples as the
standard does, perhaps provide a single example that compares the
effect of using the colon with the effect of excluding it.

The bash documentation is so long that I don't think adding this will
make it too long...  :-)

peace & happiness,
martin





reply via email to

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