标签:pre username ini passwd put exit swa bash bsp
#!/bin/bash # auth: xiluhua # date: 2017-02-26 read -p "please input a username:" username [ -z $username ] && echo "a username is needed" && exit 2 if id $username &> /dev/null then echo $username ‘is exist‘ fi read -p "please input the passward:" passward [ -z $passward ] && echo "a passward is needed" && exit 3 useradd $username echo "$passward" | passwd --stdin $username &> /dev/null echo "add $username finished"
标签:pre username ini passwd put exit swa bash bsp
原文地址:http://www.cnblogs.com/xiluhua/p/6456120.html