Results 1 to 3 of 3

Thread: Bash Script - Email Command Output

  1. #1
    Join Date
    Nov 2012
    Beans
    8

    Question Bash Script - Email Command Output

    Hello Everyone,

    I'm trying to write a bash shell script that will perform the following command.
    doall 2 24 "ipmitool sel list"

    I want to perform that command and then have the output emailed to me from the machine. I'm new to bash scripts so I am struggling a bit!

    How would I go about doing this?

    Cheers,
    Stu

  2. #2
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Bash Script - Email Command Output

    Code:
    doall 2 24 "ipmitool sel list" | mailx -s"Subject" username@host

  3. #3
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: Bash Script - Email Command Output

    Also depending on your environment, it might be impossible to send mail directly (if you have a dynamic IP or if your ISP forbids it, for example).
    「明後日の夕方には帰ってるからね。」


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •