Skip to content

Instantly share code, notes, and snippets.

@look4regev
Created August 22, 2019 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save look4regev/fad974a1a65724c571e304cb6bfc2977 to your computer and use it in GitHub Desktop.
Save look4regev/fad974a1a65724c571e304cb6bfc2977 to your computer and use it in GitHub Desktop.
Bash function to make a random 12 chars string including numbers, special chars and lower+upper case
#!/bin/bash
krand() {
# Outputs random 12 chars string including numbers, special chars and lower+upper case
dd if=/dev/urandom count=1 2>/dev/null | base64 | head -1 | cut -c4-15
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment