intercepting shell command output in run_shell, printing log on failure