annotate bin/pwgen @ 682:88888f40c628

[vimrc] Disable indent plugin Less predictable behavior with it enabled.
author nanaya <me@nanaya.pro>
date Fri, 24 Jun 2022 22:50:19 +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