Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please fill in the above blanks, thank you. 1) (5 points) The following shell script myUniq is used to create a frequency list of every

image text in transcribed

Please fill in the above blanks, thank you.

1) (5 points) The following shell script myUniq is used to create a frequency list of every word in a file. When running the shell script, the first argument should be the pathname of the file to be checked. Assume we have a file as below: This is a test Test test test There are multiple tests After running the shell script, a two-column list is displayed on the screen. The first column shows what words appear, the second column shows how often they appear, for example S./myUniq.sh test test@3 tests@l multiple@1 is@1 are@1 a@l This@1 There@l Test@1 The lines are sorted by the frequency cat $1 tr'In' > temp echo -n > file2.txt for line inA do # put all words to a new line # clear file2.txt ftrace each line from temp file # check if the current line is visited grep -q if then count= B.file2.txt #count the number of words echo ?line" 8" Scount >> file2.txt # add word and frequency to file fi done sort frequency file2.txt # sort the lines according to the

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

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions