Ich versuche, ein Scrip in Python zu machen, um die Aliase eines Benutzers, die ich ausgewählt habe, wie beim Eingeben von Alias im Terminal zu zeigen. so weit geht der Code wie folgt:Wie Benutzer Aliases in Python zeigen
tt = open("/etc/passwd" , "r")
with tt as f2:
with open("passwd" , "w+") as f1:
f1.write(f2.read())
f1.seek(0,0)
command = f1.read()
print
print command
chose = raw_input("select user's name from this list > ")
rootlist = "1) Show user groups \n2) Show user id \n3) Show users alias\n4) Add new alias \n5) Change Password \n6) Back"
print
print rootlist
print
chose2 = int(raw_input("Choose a command > "))
if choose == 3:
os.system("alias ")
jedoch os.system („Alias“) nicht funktioniert und ich kann nicht eine richtige Art und Weise t es tun zu finden scheinen.