Please include in the script some comments how the arguments work like the one I attached and
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these computer network questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
re Regular Languages and Finite Automata (a) Let L be the set of all strings over the alphabet {a, b} that end in a and do not contain the substring bb. Describe a deterministic finite automaton...
-
Give the numerical coefficient and the degree of each term. 2
-
Farm Labs, Inc. provides mad cow disease testing for both provincial and federal government agriculture agencies. Because the company's customers are government agencies, prices are strictly...
-
Make a rough sketch of the graph of each function. Do not use a calculator. Just use the graphs given in Figures 12 and 13 and, if necessary, the transformations of Section 1.3. (a) y = log10 (x + 5)...
-
Compare and contrast between various valuation methods. Which valuation methods are most appropriate for manufacturing firms and which are the most appropriate for internet-based ventures?
-
On October 1, 2014, Jay Pryor established an interior decorating business, Pioneer Designs. During the month, Jay completed the following transactions related to the business: Oct. 1. Jay transferred...
-
1. What are the five steps to creating more sustainable events? Describe and explain each step. 2. What is fair trade, and what does it mean for contract employees versus salaried employees?...
-
Jackson et al. (1987) compared the precision of systematic and stratified sampling for estimating the average concentration of lead and copper in the soil. The 1-km2 area was divided into 100-m...
-
Consider an initial insurance portfolio of 20,000 independent automobile policies, each with a standard deviation of $300 and an expected loss of $400. Now suppose that this insurer also writes 1,000...
-
Have two or more people record the minutes of each class or team meeting for a week. Compare the accounts of the same meeting. To what extent do they agree on what happened? Does one contain...
-
Research your universitys policies and practices regarding inclusion. Conduct the following research: Locate your universitys position statement on inclusion (or diversity) for both employment and...
-
Assume that youre going to the capital city of another country on business two months from now. (You pick the country.) Use a search engine to find out What holidays will be celebrated in that...
-
Before you begin working on a team project, develop a team action plan to establish a framework that will hold your team members accountable for their work. After reading the project assignment sheet...
-
In this exercise, you are going to participate in a networking event, an abbreviated talk and walk. To prepare for the event: Prepare business cards for yourself, using a computer application of...
-
A solution containing 4.48 ppm KMnO, had a % transmittance of 30.9% in a 1.00 cm cell at 520 nm. Calculate the molar absorptivity of KMnO, at 520 nm.
-
What are the main distinctions between the different schools of legal interpretation?
-
MINID Property Corp. (MINID) is a publicly held real estate company in Canada, specializing in retail real estate property. The company took advantage of the economic downturn and purchased several...
-
Oshawa Motors is a car dealership that has two types of operations: car sales and service. The two divisions operate independently and, in fact, the showroom for car sales is entirely separate from...
-
Verdant Vines specializes in cultivating rootstock for grape vines. The company sells to both vineyards and consumers. At the beginning of the year, the company had $120,000 in accounts receivable...
-
Consider the eigenvalue problem: a. Find the natural frequencies and mode shapes of the system. b. Change the coordinates in Eq. (E.1) as \(X_{1}=Y_{1}\) and \(X_{2}=3 Y_{2}\) and express the...
-
Consider the eigenvalue problem \[\left[[k]-\omega^{2}[m] ight] \vec{X}=\overrightarrow{0}\] where Find the natural frequencies by finding the roots of the characteristic equation...
-
Consider the eigenvalue problem: where Equation (E.1) can be expressed as \[[D] \vec{X}=\lambda \vec{X}\] where \[[D]=\left([m]^{\frac{1}{2}} ight)^{-1}[k]\left([m]^{\frac{1}{2}} ight)^{-1}\] is...
Study smarter with the SolutionInn App