summaryrefslogtreecommitdiff
path: root/ipl/progs/vrepl.icn
diff options
context:
space:
mode:
Diffstat (limited to 'ipl/progs/vrepl.icn')
-rw-r--r--ipl/progs/vrepl.icn32
1 files changed, 32 insertions, 0 deletions
diff --git a/ipl/progs/vrepl.icn b/ipl/progs/vrepl.icn
new file mode 100644
index 0000000..0fbd9cf
--- /dev/null
+++ b/ipl/progs/vrepl.icn
@@ -0,0 +1,32 @@
+############################################################################
+#
+# File: vrepl.icn
+#
+# Subject: Program to replicate input lines
+#
+# Author: Ralph E. Griswold
+#
+# Date: January 14, 1999
+#
+############################################################################
+#
+# This file is in the public domain.
+#
+############################################################################
+#
+# This program replicates every line of standard input a specified
+# number of times and writes the result to standard output. The
+# replication factor is given on the command line.
+#
+############################################################################
+
+procedure main(args)
+ local i, line
+
+ i := integer(args[1]) | 1
+
+ while line := read() do
+ every 1 to i do
+ write(line)
+
+end