home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / ipl / progs / limitf.icn < prev    next >
Text File  |  2000-07-29  |  902b  |  39 lines

  1. ############################################################################
  2. #
  3. #    File:     limitf.icn
  4. #
  5. #    Subject:  Program to limit throughput
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     September 17, 1998
  10. #
  11. ############################################################################
  12. #
  13. #  This file is in the public domain.
  14. #
  15. ############################################################################
  16. #
  17. #  This program is intended to be used in a pipe line.  It passes through
  18. #  at most the number of line given by the command-line option -l (default
  19. #  10). 
  20. #
  21. ############################################################################
  22. #
  23. #  Links:  options
  24. #
  25. ############################################################################
  26.  
  27. link options
  28.  
  29. procedure main(args)
  30.    local opts, limit
  31.  
  32.    opts := options(args, "l+")
  33.  
  34.    limit := \opts["l"] | 10
  35.  
  36.    every write(!&input) \ limit
  37.  
  38. end
  39.