log input to tool cmd
close stdin on tool after writing input