when writting rule to file, write also to stdout