home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!hela.iti.org!usc!cs.utexas.edu!news
- From: meyering@cs.utexas.edu (Jim Meyering)
- Newsgroups: alt.lang.awk
- Subject: using tr's [::] notation [Was: Re: tolower() function?
- Date: 27 Jan 1993 22:04:38 -0600
- Organization: U of TX at Austin CS Dept
- Lines: 20
- Message-ID: <lmemqmINNj11@ai.cs.utexas.edu>
- References: <1993Jan24.093340.17437@psg.com> <C1EzDw.FtF@austin.ibm.com> <EMCOOP.93Jan25124421@bcars148.bnr.ca>
- NNTP-Posting-Host: ai.cs.utexas.edu
- Summary: GNU tr supports [:class:] notation
-
- | > >>I often use tr for this very reason. For example:
- | > >>
- | > >> echo "HeLlO, wOrLd!" | tr [:upper:] [:lower]
- | > try | tr [A-Z] [a-z]
- |
- | The advantage to using [:upper:] and [:lower:] instead of [A-Z] and [a-z] is
- | locale support. Not everyone uses ASCII and US English.
- |
- | here's a shocker: not all tr's have that notation. must be an IBMism :-)
-
- If your version of tr doesn't support it, get GNU tr -- it does.
- Maybe you should get it anyway; it's significantly faster in many cases
- than the few vendor-supplied versions I've compared it to.
- You can find a version in the GNU textutils-1.4 release.
-
- Jim Meyering | Member of the League for Programming Freedom
- meyering@cs.utexas.edu | Contact me or lpf@uunet.uu.net for more info.
- --
- Jim Meyering | Member of the League for Programming Freedom
- meyering@cs.utexas.edu | Contact me or lpf@uunet.uu.net for more info.
-