Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!hub!lime!dz From: dz@lime.ucsb.edu (Daniel James Zerkle) Newsgroups: comp.sys.next Subject: Re: Big pain Message-ID: <2098@hub.UUCP> Date: 20 Jul 89 15:47:26 GMT References: <13066@netnews.upenn.edu> <1508@garcon.cso.uiuc.edu> Sender: news@hub.UUCP Reply-To: dz@cornu.ucsb.edu (Daniel James Zerkle) Distribution: usa Organization: University of California, Santa Barbara Lines: 40 >On a related issue; it sure would be nice if there were a unix device >called "scrap", that handled the scrap. Then, I could say: > >% cat foo bar >/dev/scrap > >or > >% enscript >Failing that, it would be ok if there were unix commands called cut, copy, >paste, and clear, with the following behaviors: > >cut - like cat, only it would write into the scrap, not stdout >copy - like cat, only it would write to BOTH the scrap and stdout >paste - would produce the contents of the scrap on stdout >clear - empty the scrap > This is trivial: Cut: prgname > /tmp/scrap (replace scrap) prgname >> /tmp/scrap (append to scrap) Copy: prgname | tee /tmp/scrap (replace scrap) prgname | tee -i /tmp/scrap (append to scrap) Paste: prgname < /tmp/scrap OR cat /tmp/scrap | whatever Clear: rm /tmp/scrap (remove scrap) cp /dev/null /tmp/scrap (empty scrap) With the C shell (or some equivalent), it should be no big deal to set up aliases called cut, copy, paste, and clear to do this. If you really want to get fancy, set up this in your .login: set scrap=/tmp/scrap$$ and refer to $scrap in your aliases. This way, each user will have a unique scrap file ($$ to the C-Shell means its own process id.) It would also be a good idea for the .logout file to remove your scrap, so there wouldn't be garbage cluttering up the /tmp file after a few people have been in and out. Have fun!