echo "text goes here" > /dev/ttyp2
where ttyp2 is the Terminal you want to write to. Switch to the other user, and you'll be able to copy the code from the Terminal. You can transfer all kinds of other information between Terminals, too. For example, to paste the contents of your clipboard try pbpaste > /dev/ttyp2.

