I'm trying to create passwords using the following snippet to match a custom password policy. I've added three gtr
statements, at the end of the string, to guarantee my password policy is met.
foo=$(gtr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 96;
gtr -dc 'A-Z' < /dev/urandom | head -c 1;
gtr -dc 'a-z' < /dev/urandom | head -c 1;
gtr -dc '0-9' < /dev/urandom | head -c 1);
echo $foo
Could this code be simplified?
gtr
command do? \$\endgroup\$brew install coreutils
\$\endgroup\$