Ravi Sir's Cards › AWS
Variable lost after a pipe loop?
This interview card answers: Variable lost after a pipe loop? A pipe runs the loop in a subshell. Read from a file or < <( ) instead. Example.
Read card text
What this card says
What it is
A pipe runs the loop in a subshell.
Why it matters
Read from a file or < <( ) instead.
How / example
Example.
done < hosts.txt