new method of generating a password; 5 random words from dict.
This commit is contained in:
parent
0553ef84f2
commit
dd3297e81a
14
append.bash
14
append.bash
|
@ -64,14 +64,16 @@ cmd_append_append() {
|
||||||
else
|
else
|
||||||
|
|
||||||
ARGS="$@"
|
ARGS="$@"
|
||||||
charstring1='"'
|
|
||||||
charstring2="\!#\$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_\`abcdefghijklmnopqrstuvwxyz{|}~"
|
|
||||||
|
|
||||||
characters="$charstring1$charstring2"
|
# old method of generating a password:
|
||||||
|
# charstring1='"'
|
||||||
length=25
|
# charstring2="\!#\$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_\`abcdefghijklmnopqrstuvwxyz{|}~"
|
||||||
read -r -n $length new_password < <(LC_ALL=C tr -dc "$characters" < /dev/urandom)
|
# characters="$charstring1$charstring2"
|
||||||
|
# length=25
|
||||||
|
# read -r -n $length new_password < <(LC_ALL=C tr -dc "$characters" < /dev/urandom)
|
||||||
|
|
||||||
|
# new method:
|
||||||
|
new_password=$(cat /usr/share/dict/words | sed "s|'s||g" | shuf -n6 | sed -z 's/\n/-/g;s/-$/\n/' | tr '[:upper:]' '[:lower:]')
|
||||||
printf "$new_password" | xclip -sel clip
|
printf "$new_password" | xclip -sel clip
|
||||||
echo "Copied new password to clipboard: "
|
echo "Copied new password to clipboard: "
|
||||||
echo "$new_password"
|
echo "$new_password"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user