25 lines
352 B
Bash
Executable file
25 lines
352 B
Bash
Executable file
#!/bin/bash
|
|
|
|
ECHOARGS=
|
|
LENGTH=12
|
|
|
|
while getopts nl: ARG; do
|
|
case ${ARG} in
|
|
n) ECHOARGS="-n"
|
|
;;
|
|
|
|
l) LENGTH=${OPTARG}
|
|
;;
|
|
|
|
?) printf "Usage: %s [-n]\n" ${0}
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
PW=$(jot -rc 256 48 123 | grep -m${LENGTH} "\w" | rs -g 0 ${LENGTH})
|
|
|
|
echo ${ECHOARGS} ${PW}
|
|
|
|
exit 0
|