Homework 2 -- sed, awk, and shell scripts

This assignment is due 27 February, 1996.

Problem 1

Write a shell script that tests your solution to Problem 1 of Homework 1. Your script should prompt its user for a choice of which of the 10 regular expressions they wish to test and then allow them to type in a line to match against the expression.

Problem 2

Write a shell script that takes three command line arguments as follows

and rewrites the file pathname replacing every occurence of oldword with newword

Problem 3

Write a shell script that takes a list of names in the following format

        J. Dean Brock
        Jane Doe
        Mary Smith

and transforms them so that the last name appears first, such as

        Brock, J. Dean
        Doe, Jane
        Smith, Mary

Problem 4

Write an awk script that removes consecutive duplicate words from a file. Your script must work correctly even if the words appear on different lines.

Return to the CSCI 373 homework index
Return to the CSCI 373 index
Return to Dean Brock's home page
UNCA CSCI logo Return to the UNCA Computer Science home page