fix popen to work with shell