代码:
1 #!/bin/bash
2
3 read -p "Please input a username:" A
4
5 if grep "^$A" /etc/passwd &> /dev/null;then
6 echo "^$A's shell is:"
7 grep "^$A" /etc/passwd| cut -d: -f7
8 else
9 echo "You fool!Give me a correct username!"
10 fi