1
0
mirror of https://github.com/aquatix/dotfiles.git synced 2025-12-06 21:45:10 +01:00

Little script to generate a (pseudo)random string of hex characters

This commit is contained in:
Michiel Scholten
2015-03-18 13:12:44 +01:00
parent 17ad2179cd
commit 04c877dd33

8
bin/randomhex Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
if [ -e $1 ]; then
NUMBERCHARS=42
else
NUMBERCHARS=$1
fi
cat /dev/urandom | tr -cd 'a-f0-9' | head -c $NUMBERCHARS ; echo