#!/bin/sh set -eu if command -v diceware >/dev/null; then PW_GENERATOR='diceware -s2' elif command -v pwgen >/dev/null; then PW_GENERATOR='pwgen -y 20 1' else PW_GENERATOR='dd if=/dev/random bs=256 count=1 | base64' fi exec vim -c 'set noshelltemp' -c "0read! $PW_GENERATOR" -c 2d -n