Skip to content

Instantly share code, notes, and snippets.

@drunkensouljah
Created July 7, 2018 22:11
Show Gist options
  • Select an option

  • Save drunkensouljah/1f432620e331dbcc5234640ea10f84f7 to your computer and use it in GitHub Desktop.

Select an option

Save drunkensouljah/1f432620e331dbcc5234640ea10f84f7 to your computer and use it in GitHub Desktop.
[Random]
!/bin/sh
#
# Creates a random string with characters from [A-Za-z0-9]
#
# Usage: ./random.sh length
#
LC_ALL=C tr -dc 'A-Za-z0-9' </dev/urandom | dd bs="${1?}" count=1 2>/dev/null
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment