Added function prototype to execute command in other process. Added check for number of pipes so that grep only executes if there are more than 2 pipes.