#!/bin/bash
#
function user {
judge=`id -u $1 &>/dev/null`
if [ $? -eq 0 ];then
uid=`id -u $1`
Shell=`grep "$1" /etc/passwd | awk -F : '{print $7}' `
echo -e " 33[32mUser is UID $uid Shell is $Shell. 33[0m"
return 0
else
echo -e " 33[31mUser is no such 33[0m"
return 1
fi
}
while :;do
read -p "input username or quit :" choice
if [ $choice == 'quit' ];then
echo -e " 33[33mQuit... 33[0m"
break
else
user $choice
fi
done