emulab/send-mail.tcl
changeset 0 2b3e5ec03512
equal deleted inserted replaced
-1:000000000000 0:2b3e5ec03512
       
     1 #!/usr/bin/tclsh
       
     2 
       
     3 #
       
     4 #    Copyright 2005-2008 Intel Corporation
       
     5 # 
       
     6 #    Licensed under the Apache License, Version 2.0 (the "License");
       
     7 #    you may not use this file except in compliance with the License.
       
     8 #    You may obtain a copy of the License at
       
     9 # 
       
    10 #        http://www.apache.org/licenses/LICENSE-2.0
       
    11 # 
       
    12 #    Unless required by applicable law or agreed to in writing, software
       
    13 #    distributed under the License is distributed on an "AS IS" BASIS,
       
    14 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    15 #    See the License for the specific language governing permissions and
       
    16 #    limitations under the License.
       
    17 #
       
    18 
       
    19 proc usage {} {
       
    20     puts "usage: send-mail <file> <copies> <destination>"
       
    21     exit 1
       
    22 }
       
    23 
       
    24 if {[llength $argv] != 3} {
       
    25     usage
       
    26 }
       
    27 
       
    28 set file   [lindex $argv 0]
       
    29 set copies [lindex $argv 1]
       
    30 set dest   [lindex $argv 2]
       
    31 
       
    32 for {set i 0} {$i < $copies} {incr i} {
       
    33     exec mail -s "TEST $i" $dest < $file
       
    34 }