home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / lang / awk / 25 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  1.4 KB

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