Hi,

This can be done, using the following:

1. assuming that your local mailbox is in "/var/spool/mail/$username", then
do the following:

--------------------------------snip------------------------------------

#!/bin/bash
regex=">"
mailbox="/var/spool/mail/$username

#list contents
cat $mailbox | grep $regex | sed -e "/$regex//g;" > /var/spool/mail/newmail

--------------------------------snip------------------------------------

2. replace all instances of $username mentioned above with the actual
filename of your inbox. If the inbox you will be searching is not your own,
then this script will have to be ran as the root user.

3. Save the above script in "/usr/bin" folder, using a suitable name, and
issue the following command:

chmod 700 /usr/bin/filename

4. Then run the script. The resultant output will appear in the file
"/var/spool/mail/newmail"

HTH,

Thomas Adam
Linux Co-ordinator for the Purbeck School (Network Support)

----- Original Message -----
From: Jon Doe <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 06, 2001 4:55 AM
Subject: [newbie] bash script to remove >?


> I know it has to be pretty simple but I can't figure it out. How can I
right
> a bash script to remove the > from forwarded emails?
>
>


Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
       [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
       users.purbeck.dorset.sch.uk


Reply via email to