 modify.py is the name of your script

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Samba is a unix/linux file sharing suite of programs designed to provide Windows interoperable
file and print sharing services. Much of the configuration for the Samba daemon is provided by
the text file smb.conf (renamed to smb.txt for this assignment). After an update was deployed to
three dozen linux servers it was discovered that a couple of configured parameters were
incorrect. Unfortunately, since there are unique aspects to each server, copying the contents of a
single file to each server is not a viable solution. To fix the problem, the IT department must
connect to each server, edit the smb.conf file, and restart the smbd daemon. To automate this
task, each server will have a Python script copied to it. Then an SSH session will be initiated to
each server from which the script will be executed. Your task is to write the Python script.
The invocation of the script must be as follows:
python modify.py fileSpec “from” “to”
where,
 modify.py is the name of your script
 fileSpec is the name of the file to be modified (smb.txt)
 “from” is the text to be searched for (be sure to enclose any white space in quotes)
 “to” is the text the searched text is to be replaced with.
Testing the script is your responsibility. However a good test case is:
python modify.py smb.txt “password sync = yes” “password sync = no”

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
ListBox
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education