Hi.
I have a shell script that will alert me when a new event has happened, basically:
<snip>
printf "A new IP, $IP was blocked from connecting to Port 80\n"
printf "A new IP, $IP was blocked from connecting to Port 80\n" | mail -s "Blacklist Alert" "$RECIPIENT"
What I would like to do is to be able to print to the screen and send an e-mail with the same message.
I want to do something like this:
printf "Sending email saying A new IP, $IP was blocked from connecting to Port 80\n" | mail -s "Blacklist Alert" "$RECIPIENT"
But also have the output sent to the screen as well.
Is it possible to do this *without* creating a named pipe, or any temporary file (using the tee, etc.)? I'd like to solve this with those as solutions, if possible.
Thanks
jouell
I have a shell script that will alert me when a new event has happened, basically:
<snip>
printf "A new IP, $IP was blocked from connecting to Port 80\n"
printf "A new IP, $IP was blocked from connecting to Port 80\n" | mail -s "Blacklist Alert" "$RECIPIENT"
What I would like to do is to be able to print to the screen and send an e-mail with the same message.
I want to do something like this:
printf "Sending email saying A new IP, $IP was blocked from connecting to Port 80\n" | mail -s "Blacklist Alert" "$RECIPIENT"
But also have the output sent to the screen as well.
Is it possible to do this *without* creating a named pipe, or any temporary file (using the tee, etc.)? I'd like to solve this with those as solutions, if possible.
Thanks
jouell