Main index

Introducing UNIX and Linux


Overview
Using filters
      Collating sequence
      Character classes
Character-to-character transformation
Selecting lines by content
      Regular expressions
      Basic regular expressions
      Extended regular expressions
      Grep
Stream editor
      Sed addresses
Splitting a file according to context
Choosing between the three filters
More on Vi
Summary
Exercises

Answer to chapter 10 question 1

We require a Grep pattern which matches the five vowels, either upper- or lower-case, separated by zero or more other characters. The pattern [Aa] matches an upper- or lower-case 'a', and the pattern .* (dot followed by an asterisk) any sequence of other characters:

grep '[Aa].*[Ee].*[Ii].*[Oo].*[Uu]' /usr/dict/words


Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck