Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

A gadget for generating user names and random passwords in batches

Shulou Source: shulou.com Published: 2022-06-03 08:11:04 09月23日 Update

Have nothing to do, write a gadget for friends to generate user names and random passwords in batches

#! / bin/bashif [- z "$1"] thenecho "Usage:. / genpasswd [- u userid] [- n user numbers] [- f password file]" exit 1fi# get optionswhile getopts "u:n:f:" argdocase $arg inu) USER=$OPTARG;;n) NUMS=$OPTARG;;f) FILE=$OPTARG;;?) echo "Usage:. / genpasswd [- u userid] [- n numbers] [- f file]" exit 1 Esacdone# debug#echo $USER#echo $NUMS#echo $FILE# generate passwordwhile [$NUMS-gt 0] doUSER= `expr $USER + 1`NUMS = `expr $NUMS-1`PASSWD = `mkpasswd.pl-C 0-s 0`echo "$USER:$PASSWD" > > $FILEdone

Tags: Password tool user user name generate idle friend Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Redmi vpn OPPO Reno Shulou Tech Info