#!/bin/csh -f
# Modifies each file given as an argument by replacing each line with
# $1 copies of the line.  Do not apply this command to its own file!

set tmpfile = /tmp/multiply.$$
foreach file ($argv[2-])
  cat $file > $tmpfile
  awk '{for (i=1; i<='$1'; i++) print $0}' $tmpfile > $file
end
rm $tmpfile
