Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Email the results of a command to you when it's finished  (Read 1084 times)

0 Members and 2 Guests are viewing this topic.

joseletk

  • Guest
Some commands take longer to complete than your willing to wait. In times like this you can have the results emailed to you with this very simple trick. Here’s a basic example:

Code: [Select]
echo "apples" | mail -s "test" me@example.com -
The above would send the email right away with the word “apples” in it. But if the command was something more time consuming such as searching for a string within a bunch of files, you might do this:

Code: [Select]
grep -i "needle" * -R | mail -s "test" username@example.com -
And then wait for the email.
=========================================================================