I need to write a script to verify if one specific entry "10.1.17.21 server1" exists in the hosts file or not. If yes, do nothing, else insert that entry into the hosts file.
This script will be put in the login script to assure all users with this entry in their hosts file.
Learn the basics of if, else, and elif statements in Python 2.7.
Use "if" statements to test a specified condition.:
The structure of an if statement is as follows:
Use "else" statements to allow the execution of an alternative, if the …