how to create and execute a script

newbie question:
I found this script on cpanel.net forums:
#!/bin/sh

cd /var/spool/exim/input/

for file in *
do
grep -l USER@DOMAIN.COM $file | xargs rm -f

done

exit
and I want to use it to purge the mail queue when it gets flooded with 1000 or more emails to the same address, the problem is I dont know even how to create a script....

Can someone take me through this step by step as to how to execute this file (i.e. what name to give it, where to place it and how to execute it)

Sorry for my ignorance...

 

 

 

 

Top