in reply to explain my fork

If you mean "why does it work" - that's because it just does. More or less - actually, you're executing some_cmd TWICE. Please read up on fork.

If you mean "why do I want this" - that's a question you should be able to answer yourself. :-)

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.