ot: mail flag for attachment in unix

Fairlight fairlite at fairlite.com
Thu Oct 1 11:28:49 PDT 2009


At Thu, Oct 01, 2009 at 10:42:00AM -0400 or thereabouts, 
suspect Kenneth Brody was observed uttering:
> Dennis Malen wrote:
> > Thanks Scott, Ken, Bill and Mark.
> > 
> > It has been confirm that in the Bourne shell there is no way to do it. That 
> > leaves me with LM or something like it.
> [...]
> 
> Don't blame the shell.  There is only one stdin.  What did you intend with 
> your syntax:

There's only one stdin, yes.  But the shell is responsible for what it
sends to stdin when fed such an ignorant mix of pipes and redirects.  In
case you missed the mail detailing my tests detailing what shells do what:

tcsh: refuses to execute the command chain outright, citing ambiguous
redirects

bourne, bash, ksh: feed the final command only the redirect, discard the
pipe data

zsh: feeds the final command first the pipe output, then the redirect, all
sequentially on the same stdin stream (albeit with no way to tell where one
stops and the other begins)

The shell determines what, if anything, is sent/run.  So it -is- a factor.
That combining pipes and redirects should never be done amounts to user
error does not escape me--I said as much last night.

I'm not even sure how we got this far off track, though.  Dennis has a mail
client that can do proper MIME attachments without relying on any shell
metacharacters at all (in fact, I think LightMail totally ignores stdin,
though I'd have to doublecheck the code--99%+ sure, though).  

Past the point where it was discovered he had an appropriate tool for the
job, this became akin to watching someone trying to paint a wall with a
jackhammer.  If he insists on continuing to do so rather than using the
paintbrush he already purchased, be it on his own head.

mark->
-- 
Audio panton, cogito singularis,


More information about the Filepro-list mailing list