Difference between cat and echo

Dan Track dan.track at gmail.com
Mon Apr 16 08:18:48 UTC 2007


On 4/13/07, Michael Schwendt <mschwendt at gmail.com> wrote:
> On 13/04/07, Dan Track wrote:
> > Hi
> >
> > I've been testing something out in cron, I ran the following:
> >
> > MAILTO: user at example.com
> > * * * * * cat % This is a test message
> > * * * * * echo % This is a test message
> >
> > When I get my emails, for the cat command, the subject states: "cat "
> > and the body states:
> > "This is a test message"
> >
> > However for the echo command I get "echo " in the subject but the body is empty.
> >
> > This made me wonder and hence ask you guys, why does cat work in
> > outputting the message while echo doesn't?
>
> cat reads the text from standard input. echo doesn't.
> If you want echo to output the same text, drop the %.
>

Hi,

Many thanks for you reply. That helps clear up a lot.

Thanks
Dan




More information about the fedora-list mailing list