in reply to The proper way to execute echo aabbcc >> file in backround

"How can I fix this?"

You can't, it does what you typed. Works as designed ;-)

Try something like perl -e 'system("tail -f foo &"); END{qx(killall tail)};'

I will be punished for this.

BTW, why do you do this?

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re^2: The proper way to execute echo aabbcc >> file in backround
by young_monk_love_perl (Novice) on Dec 06, 2013 at 13:18 UTC

    Hi, thank you for your answer,

    can't I kill the system call process by pid and call it using fork ? By doing additional research I understood that my first code was poorly designed and that I should use a separate thread, could you provide me an example doing a separate thread and then killing it by using a clean way like Signals or PID please ?

        I read those links, but the thing is that I have an infinite running process that i call with exec(my process) on a fork of my main script but the exec creates a new PID and I have no way the get that PID so i can't kill it properly ...