mirror of
https://github.com/techarkit/shell-scripting-tutorial.git
synced 2025-07-28 23:28:40 +00:00
19 lines
366 B
Bash
19 lines
366 B
Bash
#!/bin/bash
|
|
##Purpose: Check given user Exits Or Not
|
|
##Date: 27th Oct 2016
|
|
##Author: Ankam Ravi Kumar
|
|
##WebSite: https://arkit.co.in
|
|
|
|
##Start
|
|
echo -e "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
|