bug-bash
[Top][All Lists]
Advanced

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

Re: '>;' redirection operator


From: Bill Gradwohl
Subject: Re: '>;' redirection operator
Date: Sat, 24 Dec 2011 15:08:34 -0600

On Sat, Dec 24, 2011 at 1:26 PM, Chris Jones <cjns1989@gmail.com> wrote:

> I find it rather ironical that your rant should amount to a clumsy
> rewording of section 6.1, GNU Manuals, from the GNU Coding Standards:
>
> http://www.gnu.org/prep/standards/html_node/GNU-Manuals.html#GNU-Manuals
>
> Followed that link and agree with it completely.

Then went to http://www.gnu.org/software/bash/manual/bashref.html#Top and
looked up something I recently tried to figure out - Case Modification. It
says almost exactly what man bash says, so the MORE official documentation
than man bash is no better than man bash. (Actually, man bash captions this
section with "Case Modification" and the official documentation doesn't, so
man bash has more information.)

${parameter^pattern}${parameter^^pattern}...
(1) This expansion modifies the case of alphabetic characters in parameter.
(2)The pattern is expanded to produce a pattern just as in filename
expansion. (3)The ‘^’ operator converts lowercase letters matching
patternto uppercase; the ‘
,’ operator converts matching uppercase letters to lowercase. (4)The ‘^^’
and ‘,,’ expansions convert each matched character in the expanded value;
the ‘^’ and ‘,’ expansions match and convert only the first character in
the expanded value.  ...

root@billlaptop ~# x="hello there"; echo ${x^he}
hello there

'he' is the pattern. This example contradicts the first half of the 3rd
sentence. The last half of sentence 4 provides some wiggle room, but then
that would mean that a pattern can only be a single character for the '^'
case, but no where is that stated categorically. Confusing.

root@billlaptop ~# x="hello there"; echo ${x^^he}
hello there
This example contradicts the first half of sentence 4.


root@billlaptop ~# x="hello there"; echo ${x^[he]}
Hello there
root@billlaptop ~# x="hello there"; echo ${x^^[he]}
HEllo tHErE

It's only by testing with these last 2 examples that I can assume I
understand what the documentation was trying to convey, but the
documentation was insufficiently detailed to allow me to just read it and
understand what to expect without resorting to testing. As it is, I can
only ASSUME that the code is correct and the docs are weak. Only the code
authors and maintainers know for sure.

My original post was only to suggest that instead of more bells and
whistles, talent should be applied towards the documentation of what is
already there.

-- 
Bill Gradwohl


reply via email to

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