Hi
I need some help using shell script to edit a file.
My original file has the following format:
/txt/email/myemail.txt
/txt/email/myemail2.txt
/pdf/email/myemail.pdf
/pdf/email/myemail2.pdf
/doc/email/myemail.doc
/doc/email/myemail2.doc
I need to read each line. If the path is... (3 Replies)
hello,
i want to make a script to search the file contents in my home directory by a given date and output me the line that has the date... (10 Replies)
OK, best is I explain what the operating enviroment is.
Linux, but Motomagx. It is a Linux operated mobile phone, Motorola V8.
I am writting a shell script, but got stuck.
I have to delete the complete content of file 1 in file 2.
I have attached the 2 files.
You can see that the content of... (2 Replies)
Hi,
I have a text file that has a long multi-line db2 CTE query. Now I want to store all the contents of this file (i.e. the entire query) in a shell script variable. I am trying to achieve it by this: query = `cat /Folder/SomeFile.txt` But when I echo the contents of this file by saying echo... (4 Replies)
Hello,
I need to do one thing that my script creates the file
touch release.SPLASH_12_03_00_RC01.txt
Now I want to update that file with some content e.g
splashbuild::SPLASH_12_17_00_RC02.zip
Thanks (1 Reply)
Hi
I am looking for a help in designing a bash script on linux which can do below:-
1) Look in a specific directory for any new files
2) Mail the content of the new file
Appreciate any help
Regards
Neha (5 Replies)
Hi Guru's,
I am new to shell scripting. I have a unique requirement:
The system generates a single pdf(/tmp/ABC.pdf) file with Invoices for Multiple Customers, the format is something like this:
Page1 >> Customer 1 >>Invoice1 + invoice 2 >> Page1 end
Page2 >> Customer 2 >>Invoice 3 + Invoice 4... (3 Replies)
Hi/ Hello all Guru here,
I am trying to create script to remove same content from other file, already tested few idea and found that in unix it is limited to sort and uniq. There is many script for removing duplicate content however to delete all same content is non. Need your help and guide .... (7 Replies)
hi all,
i had the below script
x=`cat input.txt |wc -1`
awk 'NR>1 && NR<'$x' ' input.txt > output.txt
by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
I am new to shell scripting. I am interested how to know how to sort a content of a file using shell scripting.
I've attached the 'Input file' and the 'expected output' to this thread.
Details provided in the expected output file will provide details on how the sort needs to be done.
... (16 Replies)
Discussion started by: nkarthik_mnnit
16 Replies
LEARN ABOUT DEBIAN
test::pop3
Test::POP3(3pm) User Contributed Perl Documentation Test::POP3(3pm)NAME
Test::POP3 - Automate Email Delivery Tests
SYNOPSIS
use Test::POP3;
my $pop = Test::POP3->new({
host => $host,
user => $user,
pass => $pass,
});
# this will delete all messages from the server
ok($count == $pop->wait_for_email_count($count,$timeout),"got $count");
# find and delete a single email message which matches these rules
# see Test::Email for more information
$pop->ok({
# optional search parameters
to => ($is or qr/is like/),
from => ($is or qr/is like/),
subject => ($is or qr/is like/),
body => ($is or qr/is like/),
headername => ($is or qr/is like/),
}, "got message");
ok($pop->get_email_count() == $count, "$count emails in cache");
# get the Test::Email object
my @email = $pop->get_email();
ok($pop->delete_all() == 2, "deleted 2 messages");
# tweak MIME::Parser settings
my $parser = $pop->get_parser();
DESCRIPTION
Please note that this is ALPHA CODE. As such, the interface is likely to change.
This module can help you to create automated tests of email delivered to a POP3 account.
Messages retrieved from the server but not yet matched by a test will be cached until either that message is the first to pass a test, or
is returned by "$pop3->get_email()". Messages returned are Test::Email objects.
METHODS
"my $pop = Test::POP3->new($href);"
The arguments passed in the href are host, user, and pass.
"my $count = $pop->wait_for_email_count($count, $timeout_seconds?);"
Calling this method will result in all messages being deleted from the server. This will wait up to $timeout seconds for there to be
$count unprocessed messages found on the server. After $count or more messages are found, or after $timeout seconds, the current email
count will be returned. $timeout_seconds defaults to 30.
"my @email = $pop->get_email();"
Get all of the email messages currently in local cache. You should call "$pop3->wait_for_email_count($count)" before calling this
method if you think that there may be messages on the server yet to be retrieved. Calling this method will cause the local cache to be
emptied. Email messages returned will be Test::Email objects.
"my $count = $pop->get_email_count($check_server);"
This will return the number of email messages in the cache. If $check_server is true, then the server will be checked once before the
count is determined. If you would like to wait for messages to arrive on the server, and then be downloaded prior to counting, use
"$pop3->wait_for_email_count()".
"my $ok = $pop->ok($test_href, $description);"
Calling this method will cause the email in the local cache to be tested, according to the contents of $test_href. The first email
which passes all tests will be deleted from the local cache. Since this method only checks the local cache, you will want to call
"$pop3->wait_for_email_count()" before calling this method. "ok" will produce TAP output, identical to "Test::Simple::ok" and
"Test::More::ok".
"my $parser = $pop->get_parser();"
Test::POP3 uses MIME::Parser to process the messages. (MIME is not yet handled by "Test::Email", it will be soon.) Use this method if
you want to manage the parser.
EXPORT
None.
SEE ALSO
Test::Builder, Test::Simple, Test::More, MIME::Parser
AUTHOR
James Tolley, <james@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2007 by James Tolley
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or,
at your option, any later version of Perl 5 you may have available.
perl v5.10.0 2008-10-24 Test::POP3(3pm)