#!/bin/bash read -p "please input a username:" username if id -u $username >/dev/null 2>&1; then echo "user exists" else echo "user does not exist" fi
把上面内存保存为 test.sh , 然后 sh test.sh 运行
社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
#!/bin/bash read -p "please input a username:" username if id -u $username >/dev/null 2>&1; then echo "user exists" else echo "user does not exist" fi
把上面内存保存为 test.sh , 然后 sh test.sh 运行
转载于:https://www.cnblogs.com/dafei4/p/11146114.html
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!