summaryrefslogtreecommitdiffstats
path: root/.local/bin/random-alnum
diff options
context:
space:
mode:
authorturret <turret@duck.com>2023-11-11 16:31:43 -0600
committerturret <turret@duck.com>2023-11-11 16:31:43 -0600
commit9932a24001e292ed2fe66c32dabc3078514bb80b (patch)
tree91b998e5894bb6c2fddbabed228f82f13779fdd0 /.local/bin/random-alnum
parent952f0f8c87f2af900b53d5afe4c9dbc566b03ef4 (diff)
downloadskel-9932a24001e292ed2fe66c32dabc3078514bb80b.tar.gz
skel-9932a24001e292ed2fe66c32dabc3078514bb80b.tar.bz2
skel-9932a24001e292ed2fe66c32dabc3078514bb80b.zip
local/bin: add utility scripts on my main box
Diffstat (limited to '.local/bin/random-alnum')
-rwxr-xr-x.local/bin/random-alnum4
1 files changed, 4 insertions, 0 deletions
diff --git a/.local/bin/random-alnum b/.local/bin/random-alnum
new file mode 100755
index 0000000..893816d
--- /dev/null
+++ b/.local/bin/random-alnum
@@ -0,0 +1,4 @@
+#!/bin/bash
+CHARACTER_SET="[:alnum:]"
+read -r -n $1 rand < <(LC_ALL=C tr -dc "${CHARACTER_SET}" < /dev/urandom)
+printf "%s" "${rand}"