Exercises

 < Day Day Up > 

1.

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

2.

Write a gawk 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 a gawk program that uses the cars file (page 537), displays all cars priced at more than $5000, and sends its output to standard output.

4.

Use gawk to determine how many lines in /etc/termcap contain the string vt100. Verify your answer using grep.

     < Day Day Up > 


    A Practical Guide to LinuxR Commands, Editors, and Shell Programming
    A Practical Guide to LinuxR Commands, Editors, and Shell Programming
    ISBN: 131478230
    EAN: N/A
    Year: 2005
    Pages: 213

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