[comp.unix.questions] "system

a20@nikhefh.hep.nl (Marten Terpstra) (08/23/89)

Hi folks,

I already posted this question to comp.lang.c but since it's very UNIX
I decided to post it here as well.

Consider the following program :

----------------------------
main()
{
int count;
extern int system();

count=system(" mail -s x25-errors terpstra < /tmp/x25_errors ");

}
----------------------------

When I compile and run this (compiling without any problems) the
rather strange error message
Unknown command: "#################################################"
appears.

The "system()" system-call however is executed anyway, so everything
works OK but I don't like having that error-message appearing on my
screen everytime it is executed. (I'm going to use it in CRON so the
message would appear every 15 minutes or so on the console).

As you may have guessed 'terpstra' is my mailbox and /tmp/x25_errors
is a file containing some normal messages.
Does anyone know how to kill this awkward error message ?

Thanks,


            Marten Terpstra   email : terpstra@nikhef.nl
NIKHEF-H (National Institute for Nuclear and High Energy Physics)   Amsterdam
-----------------------------------------------------------------------------
-- Workers of the world arise, you have nothing to loose but your chairs ! --

-- 
            Marten Terpstra   email : terpstra@nikhef.nl
NIKHEF-H (National Institute for Nuclear and High Energy Physics)   Amsterdam
-----------------------------------------------------------------------------
-- Workers of the world arise, you have nothing to loose but your chairs ! --

maart@cs.vu.nl (Maarten Litmaath) (08/24/89)

a20@nikhefh.hep.nl (Marten Terpstra) writes:
\...
\main()
\{
\int count;
\extern int system();
\
\count=system(" mail -s x25-errors terpstra < /tmp/x25_errors ");
\
\}
\----------------------------
\
\When I compile and run this (compiling without any problems) the
\rather strange error message
\Unknown command: "#################################################"
\appears.

	$ strings -a `which mail` | grep 'Unknown command:'
	Unknown command: "%s"
	$

The standard input appears to contain an unknown in-band mail(1) command.
-- 
"rot H - dD/dt = J, div D = rho, div B = 0, |Maarten Litmaath @ VU Amsterdam:
  rot E + dB/dt = 0" and there was light.   |maart@cs.vu.nl, mcvax!botter!maart