SHARE
TWEET

Untitled

a guest Dec 11th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. echo " trying passwd"
  2. var2=$(awk -F: '{print $1}'  /etc/passwd | sort -r |grep $1)
  3.  
  4. #apokoptei an yparxei to username apo to passwd
  5. varq=$(id -u $1)
  6.  
  7. cat /etc/passwd | awk  -v varo="$var2" -F : '{if ($1 == varo) print $5;}'
  8.  
  9. #ean i 1h sthlh toy passwd einai to username poy psaxnoyme tote ektypwnetai h 5h sthlh poy einai to onoma
  10.  
  11.  
  12. echo "trying getent"
  13. getent passwd | awk  -v varo="$var2" -F : '{if ($1 == varo) print $5;}'
  14.  
  15. #OMOIWS me parapanw alla afti tin fora pernoyme tin lista me to getent passwd
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top