view bin/pwgen @ 651:bdc9eddf3743

[pwgen] rewrite in shell script
author nanaya <me@nanaya.pro>
date Wed, 25 Nov 2020 01:43:25 +0900
parents fea77cdcdb09
children
line wrap: on
line source

#!/bin/sh

set -e
set -u

_length="${1:-12}"

for i in 1 2 3 4 5; do
  printf "%s: " "$i"
  openssl rand -base64 "$_length" | tr '/+' '-_' | cut -c "1-$_length"
done