Created
December 10, 2019 13:29
-
-
Save varvaruc/46e1f964a89cead5d1069703e7d4e7d8 to your computer and use it in GitHub Desktop.
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 characters
#!/bin/bash | |
# Display exit status of the command: | |
# echo $? | |
echo -n "Enter user name : " | |
read USR | |
cut -d: -f1 /etc/passwd | grep "$USR" > /dev/null | |
OUT=$? | |
if [ $OUT -eq 0 ];then | |
echo "User account found!" | |
else | |
echo "User account does not exists in /etc/passwd file!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment