Create userexists.sh

This commit is contained in:
Ankam Ravi Kumar
2019-01-16 21:59:38 +05:30
committed by GitHub
parent 58c5c914b0
commit a4c06e5e90

18
userexists.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
##Purpose: Check given user Exits Or Not
##Date: 27th Oct 2016
##Author: Ankam Ravi Kumar
##WebSite: https://arkit.co.in
##Start
echo "Please Enter User name you want check:\c"
read user
grep $user /etc/passwd > /dev/null
if [ $? -eq 0 ]; then
grep $user /etc/passwd
echo "$user Exists in this Machine"
else
echo "$user does not exists"
fi
##END