/ Published in: Bash
Example:
$ randpass.sh 32
R"}I3$XzdsC0@KnjjA&U"M4$"lRLkIB@
$ for i in {1..10}; do randpass.sh; done
H,Cqby/2345UgyLWej5k
YV@{N{D
$ randpass.sh 32
R"}I3$XzdsC0@KnjjA&U"M4$"lRLkIB@
$ for i in {1..10}; do randpass.sh; done
H,Cqby/2345UgyLWej5k
YV@{N{D
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/env bash # randpass.sh # Generate semi-aleatory passwords from command line. # Usage: # ./randpass.sh [NN] # "NN" is an optional positive integer. # Default length: 20 if [ -z "$1" ] then LEN=20 else LEN=$1 fi echo $(< /dev/urandom tr -cd 'a-zA-Z0-9\<>!".$%&/()=?|@#[]{}-_.:,' \ | head -c $LEN)