Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 : Given a text file, write a script, mid 1 _ 1 . sh that takes two parameters. $ 1 , represents a

Question1: Given a text file, write a script, mid1_1.sh that takes two parameters.
$1, represents a regex pattern to match words.
$2, represents a text file. for the text file $2, find all words that match $1 and count the number of the occurrences of each word as well as the number of characters in the word. produce a table with the words sorted alphabetically and containing the columns word, count and letters. The provided script. count.sh can be used to count the number of characters of a word provided as a parameter to the script.
A sample invocation would be:
./mid1_1.sh 'th[[:alpha:]]*' speech.txt
may produce an output that looks like the following:
word, count, letters
that, 3,4
the, 20,3
their, 1,5
there, 2,5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions