Interesting... it looks like IRIX sed doesn't treat the "p" command the same way as GNU sed does. Under GNU sed, "p" prints out the current pattern space, then you can go on and do other stuff, including printing more things. But IRIX sed appears to be printing only the last thing specified for the "p" command. If I add a "q" command in the middle of the script, I get only the fragment most recently printed before the script quits. Solaris and, as far as I can tell, the IRIX sed(1) man page, seem to agree with the GNU sed behavior.