#!/bin/sh # # Copyright (c) 2019 Aaron LI # MIT License # # Generate random passwords. # # Credit: # * How to generate a random string? # https://unix.stackexchange.com/a/230676 # * password-store: # http://www.passwordstore.org/ # # usage: generate ${characters} ${length} generate() { local characters="$1" local length="$2" env LC_ALL=C tr -dc "${characters}"