Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.3: Copying text between logged in users UNIX
If you need a quick way to transfer a bit of text from one logged in user to another in Panther, you can enable Fast User Switching, open a Terminal for both users and type:

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.
    •    
  • Currently 2.43 / 5
  You rated: 2 / 5 (7 votes cast)
 
[6,916 views]  

10.3: Copying text between logged in users | 8 comments | Create New Account
Click here to return to the '10.3: Copying text between logged in users' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Copying text between logged in users
Authored by: samsprograms on Nov 27, '03 04:26:26PM

Use the 'tty' command to find the current terminal's "path".



[ Reply to This | # ]
10.3: Copying text between logged in users
Authored by: adrianm on Nov 27, '03 05:27:20PM

or download subethaedit and use it's rendezvous based collaborative editting to do much more



[ Reply to This | # ]
10.3: Copying text between logged in users
Authored by: makaio on Nov 27, '03 05:37:40PM
This fails for me with a "permission denied" error. It appears that only members of the group "tty" have permission to write to this. (I know that there are several ways around this, but none of them are ideal.) In any case, this seems like an abuse of TTYs.

Another solution might be to use a FIFO. For example:


mkfifo /tmp/blah
echo "important text" > /tmp/blah

And after you switch users and whenever you decide to retrieve the text:


cat /tmp/blah

In this case, you don't have to worry about which TTY corresponds to which terminal.

[ Reply to This | # ]

The write command exists for that purpose
Authored by: Stereo on Nov 27, '03 10:30:07PM
You can only write to another user's tty if you're root. The write command lets you send messages from one normal user to the other. e.g.

Ketchup:~ vincent$ write jules
And you know what they call a... a... a Quarter Pounder with Cheese in Paris?
^D
Don' forget the Control-d at the end. Piping the message to write or following the command with the message in double quotes works too. This will produce that on Vincent's most recently used terminal:

Message from vincent@Ketchup.local on ttyp5 at 03:17 ...
And you know what they call a... a... a Quarter Pounder with Cheese in Paris?
EOF
where EOF stands for end of file.

[ Reply to This | # ]
the 'write' command
Authored by: parakleta on Nov 27, '03 11:14:39PM

A much better way to achieve the same thing is to use the write command. You simply type

> write username

and then after that, anything you type until a Ctrl-D or Ctrl-C will appear in the terminal of the recipient. You can also do

> write username < document

if you want to push a document over.

Another related feature is talk. You need to uncomment the talk daemon in the inetd.conf file

> sudo vi /etc/inetd.conf

you need to remove the '#' in front of the line starting with #ntalk, and then save the changes and run

> sudo kill -HUP `cat /var/run/xinetd.pid`

The only problem I've found is that for some reason the copy of talk included with Panther puts ^M instead of newlines. So I installed ytalk from the fink repositories and use that instead.



[ Reply to This | # ]
10.3: Copying text between logged in users
Authored by: jwbaumann on Nov 28, '03 08:31:05PM

A very handy non-command line method for sharing text beween users (even if not simultaneously logged in) is XiTouch. XiTouch is a MySQL/PHP/Apache/Safari driven PIM which is perfect for managing thousands of loose bits of text information.
[disclosure] XiTouch is my baby and is findable thru Google and VersionTracker. [/disclosure]



[ Reply to This | # ]
10.3: Copying text between logged in users
Authored by: dfbills on Dec 01, '03 11:53:01PM

What about the good 'old "talk" command? Much cleaner than write and much more fun.



[ Reply to This | # ]
Try ClipboardSharing
Authored by: daze on Dec 02, '03 04:27:49AM

Try ClipboardSharing (http://www.lagercrantz.ath.cx). It is free and you can push and pull the clipboard between users either on one machine or over the network. Great app!



[ Reply to This | # ]