rewrite of printILine() to use temporary file instaed a pipe