Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program 1 : Suppose we have a file called protocols.txt including three columns. The first one cont ains the name of the protocol, the second

Program 1:
Suppose we have a file called protocols.txt including three columns. The first one cont ains the name of the protocol, the second one contains the input dat a flow and the third one contains the output dat a flow. The file could be shown as follows:
\table[[tcp,100,150],[udp,250,350],[ftp,150,400],[smtp,150,500],[smb,200,300]]
The fields are separated by spaces or Tabs.
(a) The program should display a menu to choose between Input and Output flow
(b) A test should be carried out whether the choice is 1(for Input data flow) or 2(for output dat a flow)
(c) A loop should verify that the given value is 1 or 2
(d) A command should display the protocol name and the input or output dat a flow with respect to the given choice
(e) The output of the command should be given in a loop to read line by line
(f) Test whether the line is empty. In this case the loop should end
(g) Store the readed value in the positional par ameters
(h) Display the data flow in form of #####, where each # symbol corresponds to the value 10
15. Program 2: Write a program which displays the users and their UID in form of a table. Only those having a UID greater or equal a given positional par ameter should be given.
The program should
(a) Test whether a position parameter is given
(b) write the command which display the users and UID separated by a space and enter the output to a while loop
(c) read the output of the executed command line by line
(d) put the line in the set of positional parameters $@
(e) test whether the UID is greather than the desired Value and display them in case of true.
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

4. Ignore small differences between scores.

Answered: 1 week ago

Question

design a simple disciplinary and grievance procedure.

Answered: 1 week ago