04-17-2008
Reading a mailbox and sending new messages to a text file
I'm new to scripting and have been tasked with creating a script that will read a mailbox, such as /var/mail/user1, scan it for new messages, then send those new messages to another file.
It also has to be looped to run almost continuously.
Any help would be greatly appreciated
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Guys,
I am trying to read text from a file, into arrays.
The format of the file is:
@DATABASE
femotest
@PACKAGE_SPECS
/usr/home/oracle92/sosa/scripts/test.pks
/usr/home/oracle92/sosa/scripts/rep.pks
@PACKAGE_BODIES
... (12 Replies)
Discussion started by: LiquidChild
12 Replies
2. Shell Programming and Scripting
Hello,
I need to send with text in the body and 2 files as attachments using sendmail command.
i can send only one at a time either attachment or text in body of email.
Can any one please help me how to get that?
I will be great for any help.
Thanks,
Sparan (1 Reply)
Discussion started by: sparan_peddu
1 Replies
3. UNIX for Dummies Questions & Answers
i need help with my script....
i am suppose to grab files within a certain date range
now i have done that already using the touch and find command (found them in other threads)
touch -d "$date_start" ./tmp1
touch -d "$date_end" ./tmp2
find "$data_location" -maxdepth 1 -newer ./tmp1 !... (6 Replies)
Discussion started by: deking
6 Replies
4. UNIX for Advanced & Expert Users
Hi Gurus,
I am having an requirement. i have to read a list file which contains file names and send mail to different users based on the files in the list file.
eg. if file a.txt exists then send a mail to a@a.com
simillary for b.txt,c.txt etc.
Thanks for your help,
Nimu (6 Replies)
Discussion started by: nimu1979
6 Replies
5. Programming
hello all ,
im trying to read a text file and display its contents. While i got the code running and the output was displayed perfectly for sometime , i started getting Abort(core dump) error . Am i missing something here ? im using HP-UX.
#include <iostream.h>
#include <fstream.h>
#include... (1 Reply)
Discussion started by: vishy_85
1 Replies
6. Shell Programming and Scripting
Hello,
I was using a shell script for sending contents of a text file(email.report) to different users.
I was using the below command in my script to send email...
cat email.report | /usr/bin/mailx -s $REQ_SUBJECT -h 5 abc@xyz.com
It was working fine all these days but now all of a sudden it... (18 Replies)
Discussion started by: smarty86
18 Replies
7. Shell Programming and Scripting
hi I need help urgently...i need to write a shell script which can solve the following problem....its urgent plz help me out coz m totally newbie in shell scripting....
the problem is:
Suppose I have a folder called logs. whenever some error occurs some correspondence error file is generated.
I... (4 Replies)
Discussion started by: sukhdip
4 Replies
8. Shell Programming and Scripting
Hi All,
When I am trying to send a text file through Unix,I get a weird symbol in the .txt file. The symbol is ? in a box (square)....which is making the file unloadable. Please help me with the solution.
Thanks in advance
Gopi (1 Reply)
Discussion started by: gopi.palleti
1 Replies
9. UNIX for Dummies Questions & Answers
I am trying to find a code that can help me mail to a list of recipients which are in a text file.
Sample code
$cat recipient.txt
me@test.com
me1@test.com
me2@test.com
I want a mailx step that can read contents of recipient.txt and mail to all the users.
I don't want to use mails... (1 Reply)
Discussion started by: Gurkamal83
1 Replies
10. Programming
Hello Team,
I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file.
Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write... (2 Replies)
Discussion started by: SA_Palani
2 Replies
LEARN ABOUT HPUX
readmail
readmail(1) General Commands Manual readmail(1)
NAME
readmail - read mail from a mail folder or incoming mailbox
SYNOPSIS
folder] [number-list|pattern]
DESCRIPTION
The program displays messages from your incoming mailbox or a specified mail folder.
Within the mail system (see elm(1) with no operands and optionally the or option, displays the appropriate headers and the body of the cur-
rent message.
With the number-list operand and no options, displays the corresponding messages and a summary of the headers from your incoming mailbox.
With the pattern operand and no options, displays the first message that matches the pattern and a summary of the headers from your incom-
ing mailbox.
Options
supports the following options.
Print all messages that match
pattern. If no pattern was specified, this option is ignored.
Use file folder for the operations instead of the incoming mailbox.
Include the entire header of the matched message or messages
when displaying their text. The default is to display the and lines only.
Exclude all headers.
Put form feeds (
between message headers. This is useful when printing sets of messages.
Operands
supports the following operands.
number-list A blank-separated list of the ordinal locations of messages in the mail file (i.e., their "message numbers"), up to
25 at a time. The character means the last message in the mail file. Similarly, represents every message in the
file (i.e.,
The message numbers are sorted into ascending order. Thus, produces the same output as
pattern A string that is present in one of the messages. This pattern can be typed in directly (no quotes) if the words are
separated by a single space in the actual message. The pattern matching is case sensitive, so and are not equiva-
lent. Leading digits (on the first word) are not permitted; however, you can precede them with a space and quote the
entire string, if the space occurs in the message, as in .
EXAMPLES
If you are using to reply to a message from within the mail system, you can insert the text of the current message with the command:
If you define an alias similar to:
you can use it with a program such to peruse mail as it arrives, without needing to start a mail system (see newmail(1)).
AUTHOR
was developed by HP.
FILES
Incoming mailbox
Temporary file for
SEE ALSO
elm(1), newmail(1), vi(1).
readmail(1)