lundi 25 mai 2020

Generate strings of varying in boundaries with bash script

I want to generate strings with lengths between 1-4 with my bash script. I know how to create strings with set length, but want to know if there is a slight alteration to the following command to make it choose between 1-4 length.

cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 4

This will create strings with numbers/letters with standard length 4. Any way to tweek it to fit my needs?




Aucun commentaire:

Enregistrer un commentaire