Bash zagnieżdżony za pętlę jedną linię
# Basic syntax:
for i in a b; do for j in c d; do echo $i $j; done; done
# Where:
# - each do statement has to end with a semicolon. *This is why there is
# a semicolon after the first done
# - multiple commands can be passed to each for loop, they just need to be
# separated by semicolons
# - for more complex for operations, sometimes it can be helpful to surround
# the do statements with parentheses, e.g.:
# for word in $(more words.txt); do (printf "$word\n" & for file in $(ls *); do (grep $word $file -c); done;) done >> output.txt
Charles-Alexandre Roy