- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- tool to edit mailfile
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2002 07:52 AM
06-11-2002 07:52 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2002 08:00 AM
06-11-2002 08:00 AM
Re: tool to edit mailfile
I hope sed command will help U for this
#sed /^
Here Mail header and footer U will have to give.
U can even specify from mail header to next blank line, or till 50 lines..etc. As per ur requirement U can customize..
I hope this will do for U.
Best of luck
Shahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2002 08:04 AM
06-11-2002 08:04 AM
Re: tool to edit mailfile
http://www.uwasa.fi/~ts/info/proctips.html#start
I'm quoting example just to show you, it's not what we got setup here.
just a thought ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2002 09:53 AM
06-11-2002 09:53 AM
Re: tool to edit mailfile
Caution: Study and test it first for I have not had opportunity to do so myself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 03:19 AM
06-12-2002 03:19 AM
Re: tool to edit mailfile
If you can not use procmail, you could use mailx(1) in a script, i.e.
for example
echo 'q' | mailx
will print a list of messages (which can then be grep(1)-ed for
Subjects: and for example
echo 'd 9\nq' | mailx
will delete message 9.
During development of the script, you can copy /var/mail/user to a file
and use "mailx -f file" so that you do not lose anything if your script
does not work right yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 04:52 AM
06-12-2002 04:52 AM
Re: tool to edit mailfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 05:02 AM
06-12-2002 05:02 AM
Re: tool to edit mailfile
since your problem is more complex than your original question made me think it was, I'll direct you to use perl and choose any of the available Mail modules from CPAN.
For mail modules you could start here:
ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/00modlist.long.html#ID19_MailandUse and pick the module that fits best to your needs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2002 05:08 AM
06-18-2002 05:08 AM
Re: tool to edit mailfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2002 02:29 AM
06-20-2002 02:29 AM
SolutionThen you can squeeze multiple space to single ones with "tr -s ' '".
The resulting output can be cut(1) into *fields* ("-f...." and "-d' '") instead of columns, and grep(1)-ed on an empty (' $') subject field.
The following works for me, but may depend on the size (i.e. one, two, three, ... digits) of the message number:
$ mailx -H -f /tmp/franks | cut -c3- | tr -s ' ' | cut -f2,9 -d' ' | grep ' $'
7
$
The first cut(1) is the tricky part.
Also putting ' $' into the SUB variable is somewhat tricky.
This seems to work:
for SUB in ' $' ....
and
grep "$SUB"
Note the single quotes in the 'for' command (because the dollar must not be interpreted) and the double quotes around $SUB (because it can contain a space, but needs to be interpreted.
You have *two* 'for' loops, so the (non)quoting becomes more complex.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2002 04:30 AM
06-21-2002 04:30 AM
Re: tool to edit mailfile
We're on our way though. We came up with the [0-9] after vi-ing the mailfile to look for nonprinted characters and such. Never knew it'd become such a monster. It's obvious you put a lot of thought into this. Thank-you.