While studying bash process substitution, I found this:
counter=0
while IFS= read -rN1 _; do
((counter++))
done < <(find /etc -printf ' ')
echo "$counter files"
If I understand correctly, the output of find command substitutes the "_".
However:
- Which mechanism is this?
- Additionally: what does
read -rN1
do?
Update:
Additional question: The process substitution is pointing to the "done" in the while loop. How does this work, i.e., why would the while loop take a substitution at that place. Is there any thing general I can read about?