pipe stdout to main process