Last active
March 5, 2021 15:49
-
-
Save CaptainCuddleCube/976c1427b3ff937a29d72bf2aa34993c to your computer and use it in GitHub Desktop.
Simple password generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
while getopts hn: flag | |
do | |
case "${flag}" in | |
n) length=${OPTARG};; | |
h) echo "-n for the number of random characters, -h for help"; exit 0;; | |
esac | |
done | |
base64 < /dev/random | head -c 1000 | sed 's/\+//g' | sed 's/\///g' | head -c $length | xargs echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment