Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please include in the script some comments how the arguments work like the one I attached and encircled. Write a python script called hoster-toaster.py that


 image

Please include in the script some comments how the arguments work like the one I attached and encircled.

image

Write a python script called hoster-toaster.py that is used to update a machine's local hostname resolution file. The details of how it works are below: It requires one argument on the command line: the absolute path to a file it will read data from. It will use the information in that file to alter the machine's /etc/hosts file. If it is run with no other options, it will overwrite the contents of /etc/hosts using the new data in the file provided as the argument. If the script is run with the option -r it will update the data currently in /etc/hosts with the information in the provided file. If an ip address in the provided file is not already in /etc/hosts, the entry (and its corresponding hostnames) will be added to /etc/hosts. If an ip address in the provided file is already in /etc/hosts, the entry already in /etc/hosts will be replaced entirely. If it is run with the option -v it will add the data from the provided file to whatever is currently in /etc/hosts. Note: This option can not be used in the same run of the command as -r If an ip address in the provided file is not already in /etc/hosts, the entry (and its corresponding hostnames) will be added to /etc/hosts. If an ip address in the provided file is already in /etc/hosts, the hostnames listed for it in the provided file will be added to the ones already in /etc/hosts.

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

Intermediate Accounting

Authors: Kin Lo, George Fisher

3rd Edition Vol. 1

133865940, 133865943, 978-7300071374

More Books

Students also viewed these Computer Network questions

Question

Give the numerical coefficient and the degree of each term. 2

Answered: 1 week ago