Sponsored Content
Top Forums Shell Programming and Scripting Run a script based on the subject line of the email Post 302305701 by nobody4 on Thursday 9th of April 2009 02:05:48 PM
Old 04-09-2009
You probably need to spec this a bit better.
It's not clear whether you need help with writing the "dojob.sh" script,
or with taking the subject line and using the information in it to invoke
the command "dojob.sh job1 copy1"

You might be looking for this:

$ sed -n -e 's/^Sub:.*job=\(.*\) copies=\(.*\)$/dojob.sh \1 \2/p' emailfile
dojob.sh job1 copy1

...which you could pipe to a shell to get it executed.



Curious people might want to know whether you have some way of intercepting
the emails and processing them automatically as they come in,
or if you plan to do this manually with copy/paste and your email client (for example).
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

use email subject line as shell command

If anyone can give me some ideas on this it would be great. What I'm trying to do is to have emails be sent to my unix account. Once they are emailed to the unix account, I want to use the text in the subject field to invoke a shell script, so basically I need to find a way that I can... (4 Replies)
Discussion started by: mskarica
4 Replies

2. UNIX for Dummies Questions & Answers

run a script from incoming email

hi I have a bit of a problem i need help with. I have a script that runs no problems when i run it manually. as soon as i stick in tester: /app/scripts/run.pl into /etc/aliases & try to run it by sending a mail it doesnt work. the output files are owned by daemon, which i dont like & think... (7 Replies)
Discussion started by: jojo77
7 Replies

3. Shell Programming and Scripting

help with script to send email and if subject line match is found

Help with script that will check log, then find a match is found, add that as the subject line. 1. The script will always run as a deamon.. and scan the event.log file 2. when a new 101 line is added to the event.log file, have the script check position 5,6 and 7 which is the job name, which... (2 Replies)
Discussion started by: axdelg
2 Replies

4. Linux

Run PHP script when new email received

I have been looking around for a solution to this, i have been developing for a wile though am very new to CGI, PHP and a lot of the web based tech. I have a web site hosted with a cPanel web host. I am looking to have a script(prefer PHP) to run everytime i get a new email to help@xxx.com.... (16 Replies)
Discussion started by: iKris
16 Replies

5. Shell Programming and Scripting

Subject line of an email

Hi all, I am trying to automate a process in which at the end of the process the script should send an email to the user saying this process is completed. I have done everything but the problem now is the subject line of the email... the subject line looks like this.. where abc xyz is a... (4 Replies)
Discussion started by: smarty86
4 Replies

6. Shell Programming and Scripting

help with email to be triggered based on fatal error detection from batch run log file neded

Hi, I require need help in two aspects actually: 1) Fatal error that gets generated as %F% from a log file say ABClog.dat to trigger a mail. At present I manually grep the log file as <grep %F% ABClog.dat| cut-d "%" -f1>. The idea is to use this same logic to grep the log file which is... (1 Reply)
Discussion started by: zico1986
1 Replies

7. Shell Programming and Scripting

Run a script when I receive an email

Hi expert I wish to start a shell script when I receive an email. I modified the aliases file and I add this string as400nag: "|/home/nag-script/startstop/AS400-Boot.sh The solution works . When the as400nag user receive an email the /home/nag-script/startstop/AS400-Boot.sh starts .but... (3 Replies)
Discussion started by: emi65
3 Replies

8. Shell Programming and Scripting

Sending sql output to email body with conditional subject line

hi , i have written below piece of code to meet the requirement but i am stuck in the logic here. the requirement are: 1) to send the sql out put to email body with proper formatting. 2) if count_matching = Yes then mail should triggered with the subject line ... (10 Replies)
Discussion started by: itzkashi
10 Replies

9. Shell Programming and Scripting

Script that will send an email if the cron job did not run.

Team, Would like to know what is the best script that will send you an email if cronjob did not run. Thanks (4 Replies)
Discussion started by: kenshinhimura
4 Replies

10. UNIX for Beginners Questions & Answers

Variable not displaying in subject line of mailx email

Hi Newbie here with first post. I've got a shell script (ksh) whereby I run a SQL*Plus script and output the results to a file. I then check the output file in an if statement that looks like this: if ]; then export GAPNUM=`awk '{print $4}' $OUTFILE` if ] then mailx -s... (10 Replies)
Discussion started by: ltzwoman
10 Replies
OutputJob(3pm)						  LogReport's Lire Documentation					    OutputJob(3pm)

NAME
Lire::OutputJob - Object used to represent a configured formatting of a report SYNOPSIS
use Lire::OutputJob; use Lire::OutputFormat; my $email = new Lire::OutputJob( 'email', $output, $output_cfg, 'emails' => [ 'email@domain.org' ] ); $email->run( 'report.xml' ); my $file = new Lire::OutputJob( 'file', $output, $output_cfg, 'filename' => '/var/www/reports/daily-%Y%m%d' ); $file->run( 'report.xml' ); DESCRIPTION
The Lire::OutputJob objects are used to represent how a report should formatted. These objects are most often created from the Lire configuration. (The 'output_jobs' specification.) new( $destination_type, $format, $format_cfg, ... ); Create a new Lire::OutputJob object. Two parameters are required: $destination_type Can be either 'email' or 'file'. $format A Lire::OutputFormat object. $format The configuration data that will be passed to the OutputFormat object. The method will returns an instance of Lire::EmailOutputJob or Lire::FileOutputJob. format Returns the Lire::OutputFormat associated with this OutputJob. format_cfg Returns the configuration data that will be used when formatting the report. run( $report_file ) Formats and sends or save the XML report $report_file according the OutputJob parameters. Lire::EmailOutputJob Extra parameters for 'email' type emails An array reference to the emails that will receive the formatted report. subjet The subject of the email. extra_file An additional text file that will be appended to text report or attach to other report types. emails() Returns as an array the emails to which the report will be sent. subject() Returns the subject of the email. extra_file() Returns the filename that will be appended to the text report or attach to the message for other report's type. Lire::FileOutputJob Extra parameters for 'file' type. file A file path with possible strftime(3pm) interpolation. This will be were the formatted report will be saved. file() Returns this OutputJob destination file. output_file( [$time] ) Returns the destination file with strftime(3) specifier interpolated. SEE ALSO
Lire::ReportJob(3pm) Lire::OutputFormat(3pm) AUTHOR
Francis J. Lacoste <flacoste@logreport.org> VERSION
$Id: OutputJob.pm,v 1.8 2006/07/23 13:16:29 vanbaal Exp $ COPYRIGHT
Copyright (C) 2004 Stichting LogReport Foundation LogReport@LogReport.org This file is part of Lire. Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2006-07-23 OutputJob(3pm)
All times are GMT -4. The time now is 06:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy