Skip to content

Instantly share code, notes, and snippets.

@kopiro
Created August 1, 2011 23:27
Show Gist options
  • Save kopiro/1119238 to your computer and use it in GitHub Desktop.
Save kopiro/1119238 to your computer and use it in GitHub Desktop.
Generate random string in Bash
#!/bin/sh
head /dev/urandom | uuencode -m - | sed -n 2p | cut -c1-${1:-8};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment