I'im using the RANDOM variable to generate a string that consists of 8 caracters. but i don't fully understand how it really works, the structure of the commande is ${char:offset:length} :
char="1234abcdABCD"
echo -n ${char:RANDOM%${#char}:8}
can someone explain how it works "specially RANDOM%${#char}? and what % and # means in this case?
Aucun commentaire:
Enregistrer un commentaire