random-password/random-password

4 lines
153 B
Plaintext
Raw Permalink Normal View History

2017-11-17 11:52:51 +01:00
#!/bin/bash
length=${1:-32}
cat /dev/urandom | tr -dc 'a-zA-Z0-9-_!@#$%^&*()_+{}|:<>?=' | fold -w $length | head -n 1 | grep -i '[!@#$%^&*()_+{}|:<>?=]'