. . . "I would do it by finding the number of lines before running the script, e.g. with coreutils and bash:" .