I have a script that runs a sql and outputs it in a temp file. That file is emailed to a distribution group hourly. How can I modify it to email only if a string is present in the file?
The last line is email 'output file' to admins and I want to change it to email output file to admins IF it contains the string 'example' in it.
---------- Post updated at 12:14 PM ---------- Previous update was at 11:34 AM ----------
Hi,
This thread is an extension of the post I posted in another folder for Unix Dummies.
I am actually trying to read all the files in a folder, let say folder A.
There are alot of .txt files in this folder where I have sed them and translate to numeric elements.
For example:-
I have... (5 Replies)
Hi All,
I like to read the log file from specific time to end of the file.
eg:
message
date and time
message 1
date and time1
message 2
EOF
I want to read all the text (Messages) after date and time to end of the file.
Please let me know the UNIX command to perform this?.
Thanks,... (9 Replies)
Hi, guys. I have one question:
I have a file called "group", the contents of it is below:
********************************
...
test:x:203:
sales:x:204:
repair:x:205:
research:x:206:brownj
...
***********
Now I want to add string ",sherrys" at the end of "research:x:206:brownj", so... (5 Replies)
Hello, I wanted to append 'XYZ' at the end of the text file. How can i do this?
I searched the forums and i am not getting what i want. Any help is highly appreciated. Thanks (2 Replies)
Hi Friends, I have a file with many lines as shown below.
/START SAMPLE LINE/
M:\mmarimut_v6.4.0_pit_01\java\build.xml@@\main\v6.4.0_pit_a
M:\mmarimut_v6.4.0_pit_01\port\Post.java@@\main\v6.4.0_pit_a
M:\mmarimut_v6.4.0_pit_01\switchview\View.java@@\main\v6.4.0_pit_a
/END SAMPLE LINE/
I... (1 Reply)
Hi friends,
I have a file containing many lines as follows.
M:\mmarimut_v6.4.0_pit_01\java\build.xml@@\main\v6.4.0_pit_a
M:\mmarimut_v6.4.0_pit_01\ADBasicView.java@@\main\v6.4.0_pit_a
I would like to append the string "\0" at the end of each line in the file. The output should look... (10 Replies)
Hi ,
I have below file with 13 columns. I need 2-13 columns seperated by comma and I want to append each row with a string "INSERT INTO xxx" in the begining as 1st column and then a variable "$node" and then $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13 and at the end another string " ; COMMIT;"
... (4 Replies)
Hi,
I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Dear All
I am having a text file which is having more than 200 lines.
EX:
001010122 12000 BIB 12000 11200 1200003
001010122 2000 AND 12000 11200 1200003
001010122 12000 KVB 12000 11200 1200003
In the above file i want to search for string KVB... (5 Replies)
Hi,
I have a scenario where I want to display the output based on the pattern search between the start and end of a block in a file, we can have multiple start and end blocks in a file.
Example give below, we need to search between the start block abc and end block def in a file, after that... (5 Replies)
Discussion started by: G.K.K
5 Replies
LEARN ABOUT DEBIAN
log::agent::driver::mail
Agent::Driver::Mail(3pm) User Contributed Perl Documentation Agent::Driver::Mail(3pm)NAME
Log::Agent::Driver::Mail - email driver for Log::Agent
SYNOPSIS
use Log::Agent;
require Log::Agent::Driver::Mail;
my $driver = Log::Agent::Driver::Mail->make(
-to => 'oncall@example.org',
-cc => [ qw( noc@example.org admin@example,net ) ],
-subject => "ALERT! ALERT!",
-mailer => [ 'smtp', Server => 'mail.example.net' ]
);
logconfig(-driver => $driver);
DESCRIPTION
This driver maps the logxxx() calls to email messages. Each call generates a separate email message. The Mail::Mailer module is required.
CONSTRUCTOR
make OPTIONS
The OPTIONS argument is a hash with the following keys:
-prefix An optional prefix for the message body.
-to The destination addresses, may be a scalar containing a valid email address or a reference to an array of addresses.
-reply_to
The reply-to addresses, may be a scalar containing a valid email address or a reference to an array of addresses.
-from The source address, must be a scalar containing a valid email address.
-subject
The subject line of the email message.
-cc The carbon copy addresses, may be a scalar containing a valid email address or a reference to an array of addresses.
-bcc The blind carbon copy addresses, may be a scalar containing a valid email address or a reference to an array of addresses.
-priority
The priority level for the email message. This is NOT related to the logging priority.
-mailer A reference to an array containing the optional arguments to Mail::Mailer->new(). Generally, this can be omitted.
NOTES
Thanks to Shirley Wang for the idea for this module.
AUTHOR
Mark Rogaski <mrogaski@pobox.com>
LICENSE
Copyright (C) 2002 Mark Rogaski; all rights reserved.
See Log::Agent(3) or the README file included with the distribution for license information.
SEE ALSO
Mail::Mailer, Log::Agent::Driver(3), Log::Agent(3).
perl v5.10.0 2002-05-12 Agent::Driver::Mail(3pm)