[Techtalk] bash script

Sean McAfee mcafee at transmeta.com
Tue Sep 18 02:33:35 EST 2001


I wrote:
>perl -MIO::Socket <<EOPERL
>\$sock = new IO::Socket::INET('205.219.16.88:25')
>    or die "Couldn't connect: \$!\n";
>print \$sock <DATA>;
>__DATA__
>Helo
>Mail From: int-dns1 at itsinc.com
>Rcpt To: ppriest at itsinc.com
>data
>Subject: netcheck
>Date check: $DAY
>Network check:itsux17$STATE

Whoops!  My message got truncated here, presumably because I included a
line containing a single period.  I presume this means someone's MTA is
misbehaving.

Anyway, here's the rest of my original message, except that the "<period>"
line was origally just a ".":

perl -MIO::Socket <<EOPERL
\$sock = new IO::Socket::INET('205.219.16.88:25')
    or die "Couldn't connect: \$!\n";
print \$sock <DATA>;
__DATA__
Helo
Mail From: int-dns1 at itsinc.com
Rcpt To: ppriest at itsinc.com
data
Subject: netcheck
Date check: $DAY
Network check:itsux17$STATE

<period>
quit
EOPERL

($sock and $! in the Perl code are preceded by a backslash to prevent
the shell interpolation that happens to $DAY and $STATE.)

-- 
"It's a deicide.  This guy Lokk arranged the murder of this guy Baldur.
 Now Baldur's Dad's going postal and threatening to end the universe..."
"I've had enough of this.  Listen, Pops, you end the universe and I'm
running you BOTH in!" -- from Top Ten #7 | Sean McAfee | mcafee at umich.edu




More information about the Techtalk mailing list