Files
toolbox-dev-env/scripts.d/10-random.sh

8 lines
172 B
Bash
Raw Permalink Normal View History

function random() {
if [[ $# -eq 0 ]]; then
num=32
else
num=$1
fi
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $num | head -n 1
}