Exercises


1.

Write an awk program that numbers each line in a file and sends its output to standard output.

2.

Write an awk program that displays the number of characters in the first field followed by the first field and sends its output to standard output.

3.

Write an awk program that uses the cars file (page 618), displays all cars priced at more than $5000, and sends its output to standard output.

4.

Use awk to determine how many lines in /etc/services contain the string Unassigned. Verify your answer using grep.




A Practical Guide to UNIX[r] for Mac OS[r] X Users
A Practical Guide to UNIX for Mac OS X Users
ISBN: 0131863339
EAN: 2147483647
Year: 2005
Pages: 234

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net