#!/bin/bash # send a file to the email box # Copyright by http://scriptdemo.blogspot.com # Note: # don't forget to change the email address to your own if [ $# -eq 0 ]; then echo "usage: mailtome file1 [file2] ..." exit fi for nf in `seq 1 $#` do eval "filename=\$$nf" if [ -f $filename ]; then mail -s "[script] $filename" YOUR-NAME@gmail.com < $filename && echo "send mail successfully" else echo "$filename dos not exist" fi done |
No comments:
Post a Comment