* WARNING: Elm and bash 1.13.cwru problems + solution
@ 1993-09-17 23:20 Arjan de Vet
0 siblings, 0 replies; only message in thread
From: Arjan de Vet @ 1993-09-17 23:20 UTC (permalink / raw)
Some people have noticed that Elm generates empty mail messages when using
bash 1.13.cwru (beta).
This is an Elm problem that has been fixed in Elm 2.4.22!
Earlier versions of Elm had a bug which does not show up when using bash
1.12 because of a bug in bash 1.12. For the exact details I have included
some correspondence with Chet Ramey, author of bash 1.13.cwru.
Arjan
-----------------------------------------------------------------------------
Chet,
I noticed a problem with my mail. My MUA (elm) calls the MTA
/usr/lib/sendmail (smail) in the following way (I wrote a /bin/sh which
logs
all parameters):
/bin/bash -c '( (/usr/lib/sendmail -oi -oem "devet@win.tue.nl" ; /bin/rm -f
/tmp/snd.03447aaa) & ) < /tmp/snd.03447aaa'
The /tmp/snd.. file contains the body of the mail. When using bash 1.12 the
body gets included in the message, but when using bash 1.13cwru I get an
empty body: the contents of the /tmp/snd.. file does not get read by
sendmail.
Any ideas how this can be solved?
Arjan
-----------------------------------------------------------------------------
Chet's reply:
-----------------------------------------------------------------------------
You wrote:
>I noticed a problem with my mail. My MUA (elm) calls the MTA
>/usr/lib/sendmail (smail) in the following way (I wrote a /bin/sh which
logs
>all parameters):
>
>/bin/bash -c '( (/usr/lib/sendmail -oi -oem "devet@win.tue.nl" ; \
> /bin/rm -f /tmp/snd.03447aaa) & ) < /tmp/snd.03447aaa'
A background job running in a non-job-control environment gets
/dev/null as stdin. Posix specifies this, and qualifies it with the
statement that explicit redirections override this implicit one. The
command to which the `&' is applied has no explicit redirections; the
redirection is applied to the subshell created because of the ( ).
This redirection happens before the shell that runs sendmail and rm is
forked.
Consider the difference between this command:
cat > ./ppp < /etc/printcap &
and this one:
cat > ./ppp & < /etc/printcap
As a consequence of the /dev/null rule, the first results in a copy of
/etc/printcap in ppp, while the second leaves ppp an empty file.
If you change the command elm runs to something like
/bin/bash -c '( (/usr/lib/sendmail -oi -oem "devet@win.tue.nl" ; /bin/rm
-f /tmp
/snd.03447aaa) </tmp/snd.03447aaa & )'
it will probably work.
This is a case where bash is not `bug-for-bug compatible' with sh.
Chet
-----------------------------------------------------------------------------
--
Arjan de Vet <Arjan.de.Vet@adv.win.tue.nl> (home)
Eindhoven University of Technology, the Netherlands <devet@win.tue.nl> (work)
--
Send submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1993-09-17 23:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-09-17 23:20 WARNING: Elm and bash 1.13.cwru problems + solution Arjan de Vet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox