mirror of
https://github.com/aquatix/dotfiles.git
synced 2025-12-07 00:05:10 +01:00
Little script to generate a (pseudo)random string of hex characters
This commit is contained in:
8
bin/randomhex
Executable file
8
bin/randomhex
Executable 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
|
||||
Reference in New Issue
Block a user