sending the output of a script through mail

ankush grover ankushfedora at gmail.com
Thu Sep 21 06:13:36 UTC 2006


On 9/21/06, redhatdude at bellsouth.net <redhatdude at bellsouth.net> wrote:
>
> On Sep 21, 2006, at 1:55 AM, ankush grover wrote:
>
> > hey friends,
> >
> > I have written a script which shows the local and lan address of a
> > system.
> >
> > #!/bin/sh
> > test= ifconfig -a | grep addr: | awk '{print $2}'
> >
> >
> > I want to send the output of this command to a user through mail. How
> > can I achieven this ?
> >
> >
> > Thanks & Regards
> >
> > Ankush Grover
> >
> > --
> > fedora-list mailing list
> > fedora-list at redhat.com
> > To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>
> Pipe it through mail
>
> test=ifconfig -a | grep addr: | awk '{print $2}' | mail -s Subject
hey,

thanks for the reply but I am able to solve the problem

sh scrip | mail user -s "test"

Thanks & Regards

Ankush Grover




More information about the fedora-list mailing list