I was running this single line for:for i in `pwgen -yB -N 8 1`; do echo $i; doneThen the output is:.DescargasDocumentosEscritorioImgenesMsicaNetBeansProjectsPlantillaspublic_htmlPblicoVdeos.}${Some of those, like Descargas, Documentos, Escritorio belongs to my home folder (Which is in Spanish), where I run my cycle.pwgen with argument -y produces at least one special nonalphanumerical character; -N param is for selecting the number of generated passwords (8) and the last 1 is for selecting the password lenght (1).I am wondering which special character can echo $i be printing as my home content.
What special character might echo be expanding to my home folder?
shell;wildcards;command substitution
Don't do this:for i in `pwgen -yB -N 8 1`The result of command substitution is subjected to pathname expansion.Do this instead:pwgen -yB -N 8 1 | while IFS= read -r i; do printf '%s\n' $i; doneExampleObserve that * appears in the output below, demonstrating that pathname expansion was not performed:$ pwgen -yB -N 8 1 | while IFS= read -r i; do printf '%s\n' $i; done~-*@;\*-