#!/bin/sh 
## Some ways to sandwich unbuffered stdin between "canned" text,
## in this case a number of head and tail lines.
## This example pipes result to grep which just numbers the lines.

(cat <<EOF1 && cat -u - && cat <<EOF2 )          | grep -n '.*'
	Headline
	Another Headline
EOF1
	Tailline
	Another Tailline
EOF2


(echo Headline && cat -u - && echo Tailline )    | grep -n '.*'


(
    echo Headline 
    echo Another Headline 
    cat -u - 
    echo Tailline 
    echo Another Tailline 
)                                                | grep -n '.*'



