tr ‘[:classname:]’ ’set2′ Here classname is the name (Web host server)

tr ‘[:classname:]’ ’set2′ Here classname is the name of one of the classes given in Table 15.1, and set2 is the set of characters you want the characters in classname to be transliterated to. For example, to get rid of punctuation and spaces, you use the punct and space classes: $ tr ‘[:punct:]’ ‘ ‘ < /home/ranga/docs/ch15.doc | tr '[:space:]' ' ' | tr 'A-Z' 'a-z' | tr -s ' ' | tr ' ' 'n' | sort | uniq -c | sort -rn | head Here's some of the new output: 405 the 170 to 136 a 134 of 122 and 119 is 80 files 74 file 72 in 67 or The numbers are different for some of the words because I ran the commands and wrote the chapter at the same time. I could also have replaced 'A-Z' and 'a-z' with the upper and lower classes, but there is no real advantage to using the classes. In most cases the ranges are much more illustrative of your intentions. Sams Teach Yourself Shell Programming in 24 Hours Contents Index Hour 15: Text Filters Previous Chapter Next Chapter Sections in this Chapter: The head and tail Commands Summary Using grep Questions Counting Words Previous Section Next Section Copyright Macmillan Computer Publishing. All rights reserved.
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

Leave a Reply