home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Mail / tnextmail / mailattach < prev    next >
Encoding:
Text File  |  1992-08-06  |  475 b   |  24 lines

  1. #!/bin/sh
  2. # Usage: mailattach [-s subject] to-address file1 ...
  3. #
  4. argsreq=2
  5. if [ $# -ge 1 ]; then
  6.     if [ "X$1" = "X-s" ]; then
  7.     argsreq=4
  8.     fi
  9. fi
  10. if [ $# -lt $argsreq ]; then
  11.     echo Usage: $0 [-s subject] to-address file1 ...
  12.     exit 1
  13. else
  14.     if [ "X$1" = "X-s" ]; then
  15.         subject="$2"
  16.         shift; shift
  17.     fi
  18.     to=$1
  19.     shift
  20. fi
  21. subject=${subject-"Files $*"}
  22. (for i in $*; do echo "\\attach{$i} `basename $i`"; done) | \
  23.     tnextmail -s "$subject" $to
  24.