echo
echo '============== User Authenticator =============='
echo
if [[ -z $1 ]]; then
echo "ERROR: enter username like: './script foo'"
echo
elif [[ -n $1 ]]; then
echo
echo -e "Enter file name: c"
read -r Uname
echo "Results location: '~/$Uname'"
touch ~/$Uname
Uresult=`cat /etc/passwd | grep $1`
IFS=:
set $Uresult
echo "Username: $1" | tee -a ~/$Uname
echo "Pass: $(sudo cat /etc/shadow | grep $1 | awk -F: '{print $2}')" | tee -a ~/$Uname
echo "UID: $3" | tee -a ~/$Uname
echo "GID: $4" | tee -a ~/$Uname
echo "Directory: $6" | tee -a ~/$Uname
echo "Shell: $7" | tee -a ~/$Uname
echo >> ~/$Uname
echo
fi