summaryrefslogtreecommitdiff
path: root/ipl/progs/filerepl.icn
blob: 46483bfd2e2b18f23968f614e819f458170565b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
############################################################################
#
#	File:     filerepl.icn
#
#	Subject:  Program to replicate file
#
#	Author:   Ralph E. Griswold
#
#	Date:     January 2, 1999
#
############################################################################
#
#  This file is in the public domain.
#
############################################################################
#
#  This program writes standard input to standard a specified number of
#  times.  Number of replications is given on command line.
#
#  NOTE:  Since the input stream is stored internally, standard input
#  must be of finite length.
#
############################################################################

procedure main(args)
   local file

   file := []

   while put(file, read())

   every 1 to args[1] do
      every write(!file)

end