Bisix

random8.sh

Feb 27th, 2021 (edited)
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.18 KB | None | 0 0
  1. nch=$((RANDOM % 2 == 0 ? 4 : 5))
  2. ndgt=$((8 - nch))
  3.  
  4. echo $(tr -dc 'a-z' </dev/urandom | head -c $nch)$(tr -dc '0-9' </dev/urandom | head -c $ndgt) | fold -w 1 | shuf | tr -d \\n
Add Comment
Please, Sign In to add comment