Rewrite shell(). Add some more run_cmd conversions