[lug] file handle and pipe

Mark Horning rip6 at rip6.net
Fri Jun 28 19:24:11 MDT 2002


Ed Hill wrote:

>On Fri, 2002-06-28 at 17:37, j davis wrote:
>
>>Hello,
>>Im a newbie. I have a var. that holds the contents of a email. I am trying
>>to send the email using sendmail like this....
>>
>>`/bin/echo $in{content} | sendmail jd\@taproot.bz`;
>>
>
>How about:
>
>  /bin/echo $in{content} | mail -s "Subject..." jd\@taproot.bz
>
>hth,
>Ed
>

Or try something like this as a function in a shell script:
mail () {
        (
                echo "To: jd at taproot.bz"
                echo -e "Subject: some subject\n"
                echo $in{content}
        ) | /usr/lib/sendmail -t
}

or from the command line:
(/bin/echo "To: jd at taproot.bz";/bin/echo -e "Subject: some 
subject\n";/bin/echo "$in{content}") | /usr/lib/sendmail -t


-- 

Mark Horning
rip6 at rip6.net






More information about the LUG mailing list