read remains of a script from write pipe on task killing