Unix Questions

Unix Questions. This is a commandline exercise. Find a way to make execute these instructions in the fastest way possible.
1. cut and paste the following to a file named the_road_not_taken
TWO roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;
Then took the other, as just as fair,
And having perhaps the better claim,
Because it was grassy and wanted wear;
Though as for that the passing there
Had worn them really about the same,
And both that morning equally lay
In leaves no step had trodden black.
Oh, I kept the first for another day!
Yet knowing how way leads on to way,
I doubted if I should ever come back.
I shall be telling this with a sigh
Somewhere ages and ages hence:
Two roads diverged in a wood, and I.
I took the one less traveled by,
And that has made all the difference
2. count the number of words
3. count the number of unique words
4. create a directory for every unique word
5. move the directories to their uppercase equivalent. For example,
mv Yet YET
6. copy the file the_road_not_taken to each directory with the name of the directory in lower case and extension is .txt
for example:
cp the_road_not_taken WORN/worn.txt
7. rename all .txt files to .doc extension. For example
mv worn.txt worn.doc
8. format the file the_road_not_taken in such a way that it will look like this:

TWO |roads |diverged |in |a |yellow |wood, |
And |sorry |I |could |not |travel |both |
And |be |one |traveler, |long |I |stood |
And |looked |down |one |as |far |as |I |could |
To |where |it |bent |in |the |undergrowth;|

Published by

Bobby Corpus

Is an IT Architect.