let cmdf fmt =
    ksprintf (fun s ->
        printf "CMD: %s\n%!" s;
        match Sys.command s with
        | 0 -> ()
        | other -> ksprintf failwith "non-zero-exit: %s -> %d" s other) fmt