“FOREACH BASH” Respostas de código

FOREACH BASH

for n in $(cat lists.txt )
do
    echo "Working on $n file name now"
    # do something on $n below, say count line numbers
    # wc -l "$n"
done

#################

input="lists.txt"
 
## Let us read a file line-by-line using while loop ##
while IFS= read -r line
do
  printf 'Working on %s file...\n' "$line"
done < "$input"
Hutch Polecat

Bash loop foreach encontrar

find . -name "*.txt" -print0 | while read -d $'\0' file
do
    …code using "$file"
done
Tame Tortoise

Respostas semelhantes a “FOREACH BASH”

Perguntas semelhantes a “FOREACH BASH”

Mais respostas relacionadas para “FOREACH BASH” em Shell/Bash

Procure respostas de código populares por idioma

Procurar outros idiomas de código