Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- LC_ALL=C tr -dc '[:alnum:]' < /dev/urandom | head -c ${1:-16}; echo;
- # might be better to use [:graph:] for some websites.
- # LC_ALL=C is the simplest local and overrides every LC setting. https://unix.stackexchange.com/questions/87745/what-does-lc-all-c-do
- # tr convertes the output of /dev/urandom the cryptographically strong random device to alnum which is all characters
- # and numbers. graph uses all printables except space
- # this is then truncated using head to 16 characters
- # Strangely enough this cuts off the infinite spew from urandom in the first half.
Add Comment
Please, Sign In to add comment