mirror of
https://codeberg.org/diginaut/dotfiles.git
synced 2026-02-04 08:50:26 +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