🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #5886

Re: Why "cat cmd | trn" works but "trn < cmd" doesn't?

#5886
From: James Brister
Date: Thu, 21 Mar 1996 00:00
22 lines
1416 bytes
Destiny Software (a04029@giant.mindlink.net) wrote:

: It should instruct trn to goto news.software.nntp group and search for 
: articles containing the word pipe, and save them in 
: ~/News/found.article.  However, I found out that "cat cmd | trn" works 
: but "trn < cmd" doesn't.  

trn is probably using select(2) on fd #0. When you do '<' that fd is
hooked to a file and selecting such a file descriptor always returns
true immediately. fd0 in the cat case is a pipe, which is selectable.
trn probably wants to select between fd0 and the fd hooked to nntpd, and
by redirecting from a file that breaks.

Expect is the application you probably should look into driving tin for
you.

James
--
James Brister                                              brister@vix.com
The Internet Software Consortium

Technical Details
Message-ID: <4isnec$6ep@the-fly.zip.com.au>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <4ij85m$dv1@fountain.mindlink.net>

Show Full Headers
Complete Article Headers
Message-ID: <4isnec$6ep@the-fly.zip.com.au>
Subject: Re: Why "cat cmd | trn" works but "trn < cmd" doesn't?
Date: Thu, 21 Mar 1996 00:00:00 +0000
From: brister@zip.com.au (James Brister)
References: <4ij85m$dv1@fountain.mindlink.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 144016306
Distribution: inet
Organization: Internet Software Consortium
Newsgroups: news.software.nntp