Created
April 22, 2016 13:10
-
-
Save g33kyrash/15e63fe5acc00b13cee5c313c5cc9054 to your computer and use it in GitHub Desktop.
Revisions
-
g33kyrash created this gist
Apr 22, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ import re, sys try: f = open("/etc/passwd",'r') except: print "\nCan't open the file!\n" sys.exit(0) #enter your username here username = "rash" k=0 for lines in f.readlines(): match = re.search(username, lines) if match: k=1 print match.group() + " exists." break if(k==0): print username + " does not exist!"