Look at this very basic Bash script:
#!/bin/bash
while read l
do
echo $l
echo "next one"
done <<< $(ps aux)
I have several processes on my computer, and the ps aux command works fine in the terminal.
I only get one iteration in the loop and ps command output is given on the same line. Why doesn't it work as intended?