Search code examples
c#bashcygwinbackground-process

getting a sh.exe for every background task


I am running about 30 processes in parallel started from a bash script using:

/MyApp arg1 arg2 &

Where /MyApp is softlink to c# executable.

I notice in tasklist that there is a "sh.exe" for each MyApp I start.

Is this expected? Or am I starting the tasks incorrectly?


Solution

  • Try running your command with exec, e.g.:

    exec /MyApp arg1 arg2&
    

    This will cause the /MyApp to replace the shell and then run in the background and you won't see an extra shell being spawned with every command.