bash pipe construct to prepend something to the stdoutput of previous command
Posted
by
AndreasT
on Super User
See other posts from Super User
or by AndreasT
Published on 2012-11-13T15:54:36Z
Indexed on
2012/11/13
17:03 UTC
Read the original article
Hit count: 286
I want to use sendmail to send me stuff and want to do it in a oneliner.
echo "mail content" | sendmail emailataddres.com
Sends it without subject.
The subject line must come before the Mail content, so I am looking for something along the lines of:
echo "mail content" | prepend "Subject: All that matters" | sendmail emailataddres.com
sed and awk tend to be really awkward to use and remember.
EDIT:Just to clarify: echo "Mail content" is just an illustrating example. I need to be able to prepend stuff to stdout streams from any source. e.g.: ifconfig, zcat, etc..
© Super User or respective owner