Question: Create a script called q 0 4 . sh that accepts a filename as a command - line parameter ( i . e . ,
Create a script called qsh that accepts a filename as a commandline parameter ie argument When run, the script will request the user to enter a word at the terminal command line user input After the input, the program should return the number of occurrences of the word within the file given by the command line parameter. The program will not stop asking for a word and returning the number of occurrences until it encounters an empty terminal user input. Make sure that the script can be run as follows:
qsh story.txt searches the file story.txt for each of the words as specified by user command line input
and produces the number of occurrences of each word given one number per line You should provide a prompt message asking the user to enter the word.
When you have completed the script answer the following questions:
Enter the word DONE in part A when you have finished your script.
How many times does the whole word happy appear in the file story.txt
How many times does the word unhappy appear in the file story.txt
Can you accurately predict, based on the number of times the word murder appears in the file story.txt and the number of times the word love appears in story.txt whether story.txt contains a murder mystery or a love story? Enter Yes or No for your answer
Enter your answers in qatxt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
