generate passwords
This commit is contained in:
@@ -142,6 +142,13 @@ zipr() {
|
||||
# cd -
|
||||
#}
|
||||
|
||||
generate_password() {
|
||||
local length=30
|
||||
local chars='A-Za-z0-9!@#$%^&*()_+[]{}|;:,.<>?'
|
||||
tr -dc "$chars" < /dev/urandom | head -c $length
|
||||
echo
|
||||
}
|
||||
|
||||
randoms() {
|
||||
echo "----------"
|
||||
|
||||
@@ -158,10 +165,12 @@ randoms() {
|
||||
randstr0="${randnum} ${ranwrd1} ${ranwrd2} ${rancmd}_${randalp}"
|
||||
randstr1="${randnum}_${ranwrd1}_${ranwrd2}_${rancmd}${randalp}"
|
||||
randstr2="${randnum}${ranwrd1}${ranwrd2}${rancmd//[^[:alpha:]]/}${randalp}"
|
||||
randstr3=$(generate_password)
|
||||
|
||||
echo "s0: ${randstr0}"
|
||||
echo "s1: ${randstr1}"
|
||||
echo "s2: ${randstr2}"
|
||||
echo "s3: ${randstr3}"
|
||||
|
||||
echo "----------"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user