Running an external command with popen4