判断输入用户名是否存在
- #!/bin/bash
- echo "Please input username:"
- read username
- grep "$username" /etc/passwd > /dev/null
- if [ $? -eq 0 ]
- then
- echo "The user is exist."
- else
- echo "The user is no exist."
- fi
转载于:https://blog.51cto.com/jiumiao/1174035
判断输入用户名是否存在
转载于:https://blog.51cto.com/jiumiao/1174035