Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You learned in class how to use a named pipe (aka FIFO) and the netcat (nc) program to turn mdb-lookup-cs3157 into a network server. mkfifo

You learned in class how to use a named pipe (aka FIFO) and the netcat (nc) program to turn mdb-lookup-cs3157 into a network server.

mkfifo mypipe cat mypipe | nc -l some_port_num | /some_path/mdb-lookup-cs3157 > mypipe

Write a shell script that executes the pipeline.

- The name of the script is "mdb-lookup-server-nc.sh"

- A shell script starts with the following line (the '#' is the 1st character without any leading space):

#!/bin/sh

And the line must be the VERY FIRST LINE in the script.

- You must make the file executable using "chmod" command.

- The script takes one parameter, port number, on which nc will listen.

- The script should create a named pipe named mypipe-, where indicates the process ID of the shell running the script. The named pipe should be removed at the end of the script.

- See section 3.4 in the Bash Reference Manual (http://www.gnu.org/software/bash/manual/bashref.html) for how to refer to the arguments and the process ID from your script.

- Because the named pipe gets removed only at the end of the script, if you quit out of the script by hitting Ctrl-C while it's running, the FIFO will not get removed. This is ok. You can manually clean up the FIFOs in the directory. If this annoys you, you can optionally add the following lines to your script after the first line:

on_ctrl_c() { echo "Ignoring Ctrl-C" }

# Call on_ctrl_c() when the interrupt signal is received. # The interrupt signal is sent when you press Ctrl-C. trap on_ctrl_c INT

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

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

Drawthe graph of the functionf (x) = x + x/2from R to R.

Answered: 1 week ago

Question

How do we organise for international logistics?

Answered: 1 week ago

Question

What are the logistics implications of internationalisation?

Answered: 1 week ago