pipefrom.sample 380 B

123456789101112131415161718192021222324
  1. #!/bin/rc
  2. rfork e
  3. TMP=/tmp/myupassend.$pid
  4. # collect upas/send options
  5. options=()
  6. while (! ~ $#* 0 && ~ $1 -*) {
  7. options=($options $1);
  8. shift
  9. }
  10. # collect addresses and add them to my patterns
  11. dests=()
  12. while (! ~ $#* 0) {
  13. dests=($dests $1);
  14. shift
  15. }
  16. echo $dests > $TMP
  17. upas/list add /mail/box/$user/_pattern $TMP >[2] /dev/null
  18. rm $TMP
  19. # send mail
  20. upas/send $options $dests