How to mark ALL mail items as read?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to mark ALL mail items as read?
# 1  
Old 07-17-2006
How to mark ALL mail items as read?

Hi guys.

Does anyone know if there is a mail command that will allow you to flag all mail items as being read? I've checked out the man mail pages, but can't seem to find what I'm looking for. Smilie

We are running UNIX AIX 5.2.

Thanks in advance,
Kev
# 2  
Old 07-17-2006
Strange, this question was asked a couple of days ago, but I can't remember if I replied, so I'll do so this time.

If you have mailx you can:

delete *

otherwise

you could remove the mail spool for the user in question if you have the required permissions to do so.

or else do sometthing linke this:

Code:
#! /usr/bin/ksh
#
#
MAIL_INDEX_LIST=$(mail << EOF | sed -n 's/^[>     ][      ]*\([0-9][0-9]*\).*/\1/p'
h a
q
EOF
)

mail |&

for i in $MAIL_INDEX_LIST ; do
    print -p p $i   ### EDIT change d to p
done
print -p q


Last edited by reborg; 07-17-2006 at 12:54 PM..
# 3  
Old 07-17-2006
Hi reborg,

Yeah, a similar question was asked a couple of days ago, but that was asking for a way to delete all items from a mailbox. I was wondering if there was a quick and simple way of flagging all mail items as being read. (...without deleting them).
# 4  
Old 07-17-2006
Sorry, my mistake.

see my edits above in the ksh script.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read a lis, find items in a file from the list, change each item

Hello, I have some tab delimited text data, file: final_temp1 aname val NAME;r'(1,) 3.28584 r'(2,)<tab> NAME;r'(3,) 6.13003 NAME;r'(4,) 4.18037 r'(5,)<tab> You can see that the data is incomplete in some cases. There is a trailing tab after the first column for each incomplete row. I... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

2. UNIX for Dummies Questions & Answers

read mail question

how do I save a email I just read to a new file? Thanks. (3 Replies)
Discussion started by: drew211
3 Replies

3. Shell Programming and Scripting

script to read mail

Hi, I want to write a script that will read mail ( for eg: from abc.def@yahoomail.com ). And if it finds a particular subject then do something.. Is it possible.... Please help... Thanks in adv.. (8 Replies)
Discussion started by: PRKS
8 Replies

4. Shell Programming and Scripting

script to read mail on a mail server

Hi All, Is there any way Unix shell script can directly read a mail on a mail server (for eg. abc@xyz.com) and save it as a text file in a unix directory ? Thanks PRKS ---------- Post updated at 08:37 AM ---------- Previous update was at 08:36 AM ---------- I am using ksh (1 Reply)
Discussion started by: PRKS
1 Replies

5. UNIX for Advanced & Expert Users

How to read mail attachement

I want to read attachements sent to unix mail id and save the attachement in folder. I may receive the mails from different mail clients(outlook, lotus ..etc). Attachements are in CSV(comma saperate) format. Let me know the shell script code for this. Regards, Venkat (1 Reply)
Discussion started by: svenkatareddy
1 Replies

6. Shell Programming and Scripting

awk between items including items

OS=HP-UX ksh The following works, except I want to include the <start> and <end> in the output. awk -F '<start>' 'BEGIN{RS="<end>"; OFS="\n"; ORS=""} {print $2} somefile.log' The following work in bash but not in ksh sed -n '/^<start>/,/^<end>/{/LABEL$/!p}' somefile.log (4 Replies)
Discussion started by: Ikon
4 Replies

7. UNIX for Dummies Questions & Answers

How do I read mail in /var/spool/mail?

How can I read mail sent to /var/spool/mail? I do not have pine installed so forget about that...is there some generic utility I can use? (3 Replies)
Discussion started by: mojoman
3 Replies

8. Shell Programming and Scripting

script to read from mail

Hi, I have a requirement in which I have to read mail from a unix text file and scan records having failed records (any number > 0) Firstly it should compare the file creation_date with sysdate if the dates match then do the checking for failed records sample file i/p Staged 0... (0 Replies)
Discussion started by: misenkiser
0 Replies
Login or Register to Ask a Question