by KayEss · 7y ago · 0 comments
#! /bin/bash
cat /dev/urandom | base64 --wrap ${1:-"10"} | head -n 1
Defaults to 10 character passwords, but you can put bigger numbers as the first argument. I don't think the `base64` command is on the Mac, so probably won't work there.tr -dc '[:print:]' < /dev/urandom | head -c 20