Results 1 to 3 of 3
Is it possible to create a shell script that will run a shell command and email the results?...
- 04-06-2010 #1Just Joined!
- Join Date
- Apr 2010
- Posts
- 2
shell command redirect to e-mail
Is it possible to create a shell script that will run a shell command and email the results?
- 04-06-2010 #2Code:
#!/bin/sh BODY=`cat message.txt` BODY2="ls -la /root" BODY3="" BODY4="" EMAIL=blah@blah.com if [ -n "${BODY}" ]; then ( echo "Subject: omg"; echo "To: $EMAIL"; echo "From: Count Chocula <count.chocula@joke.com>"; echo; echo "$BODY" echo "$BODY2" echo "$BODY3" echo "$BODY4" ) | /usr/lib/sendmail -f daCount $EMAIL filinux user # 503963
- 04-06-2010 #3Just Joined!
- Join Date
- Apr 2010
- Posts
- 2
Works perfectly! Thank you!


Reply With Quote