implement the main ks wrapper program piping/forking/execing/waiting