inside Habbie's mind

Entries tagged “sed”

Unix trivia: echo cat | sed statement

written by peter, on May 24, 2010 8:48:00 AM.

I occasionally run into weird, funny or surprising aspects of Unix and Unix-like Operating Systems. I'll try to post about those regularly because they're fun.

This one popped up on irc a few weeks ago; a google search suggests it's at least 6 months old. I have been unable to track the original source down.

The question is: if you input echo cat | sed statement into your Unix shell, what comes out? Can you predict it? If not, can you try it and then explain it?