give the commands make -f mktst tstpaku > out abcdefghijklmnopq ed out g/$/s//X/p This will display the output and make all the blanks visible. Three extra lines are generated at the end. This presumably comes from tstpak and not from the subroutines. How can one give a format statement that will avoid this yet handle the longest lines that might occur.