On Thu, Jul 13, 2000 at 01:48:15AM -0700, Felix Lee wrote:
> Lars J. Aas writes:
> > : -for warning in `IFS=,; echo syntax,$WARNINGS,$warnings | tr [A-Z] [a-z]`
> > : +for warning in `IFS=,; echo syntax,$WARNINGS,$warnings | tr '[A-Z]' '[a-z]'`
> > Why use the braces at all? Are they really necessary? tr A-Z a-z has
> > always worked for me, and that format won't be expanded by the shell.
>
> The square brackets were a system-V-ism, SVID era. I don't
> have any manuals from that era any more, but I seem to think
> that 'A-Z' without the brackets would be considered just
> three chars, not a range. this was completely different
> from BSD Unix behavior, but '[A-Z]' worked on BSD cuz its tr
> would treat the '[' as a non-magic character and translate
> '[' to '['. so script writers just used '[A-Z]' all the
> time in self-defense.
>
> these days, we have POSIX thingies in tr like '[:alpha:]' so
> '[' is magic again, sometimes, depending.
in turn, all of this was noted a year or so ago to point out it won't
work on systems using EBCDIC - an explicit range is ugly but portable.
--
Thomas E. Dickey <[EMAIL PROTECTED]>
http://dickey.his.com
ftp://dickey.his.com