garric 0 Newbie Poster

i wanted to write a shell script that can automatically read unread mails and copy each one into a different file. I was trying to use the MAIL command to do it, but this command requires user input inbetween, I was wondering how that could be achieved in a shell script. Any help would be of great use.

any othe commands that can be used to achieve the same.