in reply to Backticks within child process

When the "ps" line is commented out, I see:

hello	world
hello	world
hello	world

When I remove the comment I get

hello	hello	hello	my@prompt:~$ world
world
world

I think I understand it now. I was thrown off by the fact that the "ps" line doesn't do any printing, so I didn't understand how it managed to "jumble" the output. I didn't understand that the time that command takes to run was was important. Thanks for all your input.

Replies are listed 'Best First'.
Re^2: Backticks within child process
by dave_the_m (Monsignor) on Jul 09, 2012 at 23:58 UTC
    One extra fact: when perl executes the backticks, it flushes the STDOUT buffer: that's why when you include the backticks, the half-lines get flushed to STDOUT, appearing to get jumbled up with half lines from the other processes.

    Dave.