Question: 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.
 Program 1: Suppose we have a file called protocols.txt including three

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!