Clean up UNIX mail box using script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Clean up UNIX mail box using script
# 1  
Old 09-27-2012
Clean up UNIX mail box using script

Hi,

I would like to clean up by unix mail mail box thru some script command.. I do know how to delete from mail box ...

e.g.

$ mail
? d*
? quit

But I need to clean up thru some command which I can use in my script before sending any email..

Thanks in advance!

Last edited by pareshkp; 09-27-2012 at 05:30 PM..
# 2  
Old 09-27-2012
Code:
yes d | mail >/dev/null 2>&1

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX Script to clean files

Hello All, I need a script that would delete files which are more than "X" number of days old, also if there can be a log file of the deleted files for reference. I am from windows background hence finding it difficult. Any help is much appreciated Regards Wert (4 Replies)
Discussion started by: wert468
4 Replies

2. Shell Programming and Scripting

UNIX mail box

Currrently I am not able to send/receive any emails to email id. I believe my mail box is full in server. could you please let me kknow to clear the emails in the unix server. (2 Replies)
Discussion started by: ramkumar15
2 Replies

3. Solaris

Mail system Configuration issue on UNIX box

Hi, I wanted to configure a mail system on my UNIX box. For that I read a document Sun Internet Mail Server 3.5 Advanced Installation Guide: Contents which is actually quite useful document but I am not sure from where can I bring patch? Is this patch will come in any CD form which I need to run... (1 Reply)
Discussion started by: Dhruvak
1 Replies

4. Shell Programming and Scripting

ftp file starting with particular name on Windows box to Unix box using shell script

Hello all ! I'm trying to write a shell script (bash) to ftp a file starting with particular name like "Latest_" that is present on a Windows box to UNIX server. Basically I want to set this script in the cron so that daily the new build that is posted on the Windows box can be downloaded to the... (2 Replies)
Discussion started by: vijayb4u83
2 Replies

5. Shell Programming and Scripting

Unix Mail Box

Hi Friends, I'm new to Unix. I have a fbackup step like /bin/nice /etc/fbackup -f /dev/rmt/0m -i / -I /opt/monitrol/tmp/Index.full 2 > /var/adm/error.log the errors for this step is redirected to a log file. How can I make to trigger mails when error occurs. Please suggest. Thanks in... (4 Replies)
Discussion started by: avik.nandi
4 Replies

6. UNIX for Dummies Questions & Answers

unix script to check if rsh to box and send status mail

rshstatus=`rsh -n lilo /db/p2/oracle/names9208/restart_names.sh` if $rshstatus <>0 then errstatus=1 mailx -s "xirsol8dr" ordba@xxx.com >> $log_dr else if errstatus=0 echo "status to xirsol8dr successful" can anyone provide if this is t he correct way to do this or is there a better way? (1 Reply)
Discussion started by: bpm12
1 Replies

7. UNIX for Dummies Questions & Answers

Receive e-mail on unix box

Hi, I am not sure if it is a good question or not. Is there a unix utility which can be configured with exchange server and then receive e-mails? Thanks! (4 Replies)
Discussion started by: DejaVu
4 Replies

8. Shell Programming and Scripting

calling a unix script in one box from another box

i have a unix script which is available in a box say box1 i want this script to be run in box box2 and put the output file in box2 what is the procedure to execute this script in box2 i will call the script in box1 using cybermation (1 Reply)
Discussion started by: trichyselva
1 Replies

9. UNIX for Advanced & Expert Users

concurrency issue while Accessing Mail Box from shell script

Hi Bros, I am in a serious trouble with concurrency issue while using mailx. I have a shell script which reads all the emails of a unix user account and create a copy (another mbox for processing and archive purpose). This script works fine for 99.99% of the time but sometime it start creating... (2 Replies)
Discussion started by: Sumit_Fundoo
2 Replies

10. Shell Programming and Scripting

Mail from unix box

I am executing the below script from unix box If row count is zero the mail should not set to the client The problem is, if row count is zero the mail is going to the client (what is wrong in the script) SET HEAD OFF FEED OFF PAGES 0 Select count(*) as change_count from... (9 Replies)
Discussion started by: pmsuper
9 Replies
Login or Register to Ask a Question