Where does the command in the braces run? In current bash or the newly opening Telnet terminal?
{
sleep 2
echo "root"
sleep 2
echo "password"
} | telnet 192.168.1.11
If the command in the braces is run in current bash, then both the command before the pipe(|
) and after the command are started at the same time? It's really out of my expectation.
I used to call commands like find . -type f | du -sh
, I thought du
is called when find
has finishes its work.
Could somebody shed somelight on this matter?