Answered step by step
Verified Expert Solution
Question
1 Approved Answer
python please!! H!/usr/bin/python import os import re import sys def man() : for ifne in sys, stdint Add a line of code here. Use re.match
python please!!
H!/usr/bin/python import os import re import sys def man() : for ifne in sys, stdint Add a line of code here. Use re.match and create a regular expression to check for the presence of a " at the start of a 1ine. We want to skip any iines in the file that starts with a hashtag: Create your regex (I suggest re. match) and save the result in a variable named "match" match = username=fields{0}password=fields{1} gecos = "s ts ts, " (fields[3], fields [2]) groups - flelds[4].split (1,1) tadd comment - what does this do and why? print "m Creating account for $5..." | (username)) cmd = "/usr/sbin/adduser _-disabled-password --gecos. 'is' is" in (gecos, username) fprint cmd os. system (cmd) iwhat does this line do? print " setting the password for is..." 1 (username) cmd ="/bin/echo ne "bsints' I /usr/bin/sudo /usr/bin/passwd ts" i (password, password, username) (password, password, username) \#print cond os.system (cmd) for group in groups: Hadd comment - what is this FOR loop doing and why? if group 1=11 : print " Assigning ts to the ts group..." i (username,group) cnd = "/usx/sbin/adduser fs ts" i (username, group) -print and os. system (cmd) if _name = - main = Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started