       dup fileId ?targetFileId?
              Duplicate  an  open  file.  A new file id is opened
              that addresses the same file as fileId.

              If targetFileId is specified, the the file  is  dup
              to this specified file id.  Normally this is stdin,
              stdout, or stderr.  The  dup  command  will  handle
              flushing  output  and  closing  this file.  The new
              file  will  be  buffered,  if  its  needs   to   be
              unbuffered,   use  the  fcntl  command  to  set  it
              unbuffered.

              If fileId is a number rather than a  Tcl  file  id,
              then  the  dup command will bind that file to a Tcl
              file id.  This is usedful for accessing files  that
              are  passed  from the parent process.  The argument
              ?targetFileId? is not valid with this operation.

              On Windows 95/NT, only stdin, stdout, or stderr  or
              a non-socket file handle number maybe specified for
              targetFileId.  The dup command  does  not  work  on
              sockets on Windows 95/NT.

              This command is provided by Extended Tcl.
