3. Solutions: Using sed to implement morphological rules

Let's get a local copy of this file and give it a name, by running the following commands:

      wget http://www.inf.ed.ac.uk/teaching/courses/inf1-cg/labs/lab4/nouns.txt
      NOUNS=nouns.txt
    

Now when you type in the following (including the '$'):

      cat $NOUNS
    

you should get the same list of animals as before.

Now type in the following command in your terminal window:

      alias plural='sed "s/$/ z/g"'
    

Now when you type in the following:

      plural $NOUNS
    

You should get the same list as before, where the plural suffix 'z' has been added to each noun in the file.