Searching files
Create a script
to display the appropriate Unix command and the result of
the command for each of the following: (use /usr/share/dict/words)
You should show me the command also (e.g., echo it and then run it). For
example, if question one is to display the lines that contain an axyz, your script would contain
the following two lines:
echo "1. grep axyz words"
grep axyz words
Set a variable w to the dictionary(words)
- Display the 8th word in the dictionary that contains a th
AND Q
- Display the head of all the words that begin with quin
- Display the head of all the words that end with rky
- Display the head of all the words in the dictionary that start with an uppercase
letter and end with ky
- Display a count of all the words that contain an uppercase letter
- Display a count of all of the words that contain an q or Q
- Give another command to answer the previous question (number 6)
- Display the number of words that begin with Sl (e.g., Sleep)
- That is a capital "ESS" and and lower case "el"
- Display the number of words that do not begin with Sl
- Display a count of the words that don't contain a vowel regardless of case
- Define a variable v that contains aeiou
- Display the head of all the words that start with a vowel (defined in question 11)
and end with ky
- Define a variable c that contains the 21 lower case consonants
- Display the count of the number of words that contain 5 lower case
consonants in a row
- Display as accurate of a count as possible of the number
of times that you have used grep (hint: history uses the file .bash_history)
- Display the head of all the words that contain 3 consonants, followed by two vowels,
followed by 3 consonants
- Use grep flags to display the count of the number of words that have an x in it regardless of case.
- Display the count of the number of words that have an F and a T.
To hand in this assignment:
move the code and the output to obisdian dropbox (call it assign7
and assign7.out, PLEASE)