From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RDNS_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 Received: (qmail 26333 invoked from network); 28 Mar 2020 11:20:22 -0000 Received-SPF: pass (minnie.tuhs.org: domain of minnie.tuhs.org designates 45.79.103.53 as permitted sender) receiver=inbox.vuxu.org; client-ip=45.79.103.53 envelope-from= Received: from unknown (HELO minnie.tuhs.org) (45.79.103.53) by inbox.vuxu.org with ESMTP; 28 Mar 2020 11:20:22 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id AA08D9D710; Sat, 28 Mar 2020 21:20:17 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id EFF369D577; Sat, 28 Mar 2020 21:19:50 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 4AD169D578; Sat, 28 Mar 2020 21:19:48 +1000 (AEST) Received: from nimbus.fccf.net (nimbus.fccf.net [185.117.82.79]) by minnie.tuhs.org (Postfix) with ESMTPS id 603C19D577 for ; Sat, 28 Mar 2020 21:19:47 +1000 (AEST) Received: from straylight.m.ringlet.net (unknown [93.152.146.108]) by nimbus.fccf.net (Postfix) with ESMTPSA id 43A0E364 for ; Sat, 28 Mar 2020 13:12:35 +0200 (EET) Received: from roam (uid 1000) (envelope-from roam@ringlet.net) id 620121 by straylight.m.ringlet.net (DragonFly Mail Agent v0.12); Sat, 28 Mar 2020 13:12:34 +0200 Date: Sat, 28 Mar 2020 13:12:34 +0200 From: Peter Pentchev To: Dave Horsfall Message-ID: <20200328111234.GA342169@straylight.m.ringlet.net> References: <20200308151332.GA70333@clarinet.employees.org> <5dbf2153-5993-242a-5ba9-54b49a38569e@spamtrap.tnetconsulting.net> <20200323084943.GA341861@straylight.m.ringlet.net> <20200324094710.GB83316@clarinet.employees.org> <127f7c5c-a607-8f5b-1760-5a308c279836@tnetconsulting.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline In-Reply-To: Subject: Re: [TUHS] sockets (was Re: First appearance of named pipes) X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 26, 2020 at 01:38:17PM +1100, Dave Horsfall wrote: > On Wed, 25 Mar 2020, Grant Taylor via TUHS wrote: >=20 > > =C2=B7 netcat's STDOUT to grep's STDIN > > =C2=B7 grep's STDOUT to netcat's STDIN >=20 > Are you trying to set up a loop of processes or something? I'm not sure = if > that is even possible, although you can't rule out creative uses of dup2() > etc... This can't really be done with netcat, but it's quite easy to do with socat; here's an example with a trivial program that reads lines from its standard input and writes a single line to its standard output: [roam@straylight ~]$ socat -v tcp4:nimbus.fccf.net:25 exec:./heysmtp.py > 2020/03/28 13:09:04.005497 length=3D48 from=3D0 to=3D47 220 nimbus.fccf.net ESMTP Postfix (Debian/GNU)\r < 2020/03/28 13:09:04.018931 length=3D6 from=3D0 to=3D5 QUIT\r > 2020/03/28 13:09:04.035387 length=3D15 from=3D48 to=3D62 221 2.0.0 Bye\r [roam@straylight ~]$ All the output was actually from socat because of the "-v" option specified. G'luck, Peter --=20 Peter Pentchev roam@{ringlet.net,debian.org,FreeBSD.org} pp@storpool.com PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13 --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEELuenpRf8EkzxFcNUZR7vsCUn3xMFAl5/MR0ACgkQZR7vsCUn 3xOvDRAAh6zc8UqP3aGv1EJ2qdpcPFUOEC89nWeeYXHX9yPMB5MmqRvvMtjEBoj8 74dVFhQ5AReQ8fX7VrG0p+lswtfw7IG9Ko4jyn/6HiUnPsXsbuNNeRd+2QY/fUEq 8niNVS+2MPpET9dGpsijZZKlwUAJ0819DzsCgrmSTidufmp/4izOeMGhjhEfvj+T LixawTiiQrSkaB7k4/bpK/FO34GFClzYMG48td9RW749+sCe+lBvJtEoAoI3dTWs sBfDYrbUh5gf3ZvxPm8Z5JZkIP8DXBo79LGvlbcAmVYsxLdoVMmgbBWbwUIW14qa dkHfK3nbMkYSEovr1HFexwJ6BBr7cx3t30kw3hIKPVpohsHkkw1U6UXK4wNjZwaf SRQIKiMMzuor+Yh5jkAM4F/qXLjaSR8ptFjshWAxyszQ+LY0wBSS7M7rG8BnCeeZ nlSg3+wC0+h9VqJsImGdRysYpiTp1WZwoFs25HFAoJmVt68DsDibTLByuYe0B4R7 76cUlxKRJbNZmw6Ej7Fs7YvdIOHRf2oJe2FC4kzR6R6xpQhJaGmf1Z/WTNzpyAQT q5bktGFkvQkSJ3WVXCElX+V7MqrCrugGd/GL1rGgNJkJW1PyvKm7wRNexs+0xmPo koaBbrFbeTHRJPxSAqWdVUFU5+l3xUul1CW0ADWlfJ+5AJfQmIo= =NusP -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X--