You're really looking at what's termed
flow control, and/or (re)direction -- again;
flow control, or
stdout (standard in / standard out).
I hope my above statement helps you better understand what's intended to occur, and what you can better expect.
pipe, or "piping"
stdout, merely directs
stdout in most cases.
Parallel is really another name for tandem. You can attempt to run 2 different/same commands/outputs at the same time. But expecting a synchronized run would be unwise, as it's unlikely to occur.
To your example; Here you introduce what's called a conditional. Much the same as a road sign, or a traffic light. These conditional(s) direct flow based on a condition. In your example, the while "condition" -- while this, do that. Conditions generally redirect
In direct answer to your 2 direct questions
- Does pipe run in parallel
No. not necessarily. At least not in the normal sense of "parallel" (tandem).
pipe can fire (initiate) 2 jobs at the same time. Even the same job twice.
- How pipe and redirection work "under the hood" ?
I hope I've better illustrated that for you above. :)
cat ./ASCII | grep somename >./output
cat ./ASCII is output (
stdout). Which becomes input (
stdin) by way of pipe (
grep somename. Which is (re)directed (
>) to its final output