4.3BSD/usr/contrib/icon/book/09/copy2.icn

procedure main()
   if not (intext := open("shaw.txt"))
   then stop("cannot open input file")
   if not (outtext := open("shaw.cpy","w"))
   then stop("cannot open output file")
   while line := read(intext) do {
      write(line)
      write(outtext,line)
      }
end