annotate bin/pwgen @ 705:500c3e9bf73f

[setup] add missing done message
author nanaya <me@nanaya.net>
date Sun, 18 Dec 2022 20:46:51 +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