questions - Question:add line at top and bottom of file before sending it to pipe

I have a text file, say, text.

What I want to do is to put the text file into pipe (as in cat text |), but with added line at top and bottom - but without creating a new file (because the text file is kind of big) or modifying it.

Is that possible? I was thinking echo $(echo "line"; cat text; echo "line") but I don't like that.

asked Sep 13, 2013 in Java Interview Questions by anonymous
edited Sep 12, 2013
0 votes

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.