annotate bin/pwgen @ 662:f280738a90a6

[vim] vendor theme and add some more
author nanaya <me@nanaya.pro>
date Fri, 10 Dec 2021 20:20:30 +0900
parents bdc9eddf3743
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
651
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
1 #!/bin/sh
478
8956a404dba6 Added random password generator.
edogawaconan <me@myconan.net>
parents:
diff changeset
2
651
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
3 set -e
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
4 set -u
478
8956a404dba6 Added random password generator.
edogawaconan <me@myconan.net>
parents:
diff changeset
5
651
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
6 _length="${1:-12}"
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
7
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
8 for i in 1 2 3 4 5; do
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
9 printf "%s: " "$i"
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
10 openssl rand -base64 "$_length" | tr '/+' '-_' | cut -c "1-$_length"
bdc9eddf3743 [pwgen] rewrite in shell script
nanaya <me@nanaya.pro>
parents: 495
diff changeset
11 done