Answer 3.4

3.4 Using Pipes

Exercise 3b

Using pipes, print all lines of list1 and list2 containing the letter 'p', sort the result in reverse alphabetical order, translate to uppercase, and print to the screen.

 

Answer

% cat list1 list2 | grep p | sort | tr "[:lower:]" "[:upper:]"

 

M.Stonebank@ee.surrey.ac.uk, © November, 2002