Skip to content

Instantly share code, notes, and snippets.

@colehocking
Created January 3, 2019 19:23
Show Gist options
  • Save colehocking/a6ee02cd58260d1ecc80c8d43ecd1469 to your computer and use it in GitHub Desktop.
Save colehocking/a6ee02cd58260d1ecc80c8d43ecd1469 to your computer and use it in GitHub Desktop.
generate a random variable of length 0-10
#!/bin/bash
# Generate a random variable of length 0-10
head -c 500 /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9~!@#$%^&*_-' | fold -w $((RANDOM%10)) | head -n 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment