Xref: utzoo comp.unix.questions:26772 comp.unix.internals:973 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!bu.edu!shelby!agate!linus!philabs!nbc1!scott From: scott@nbc1.ge.com (Scott Barman) Newsgroups: comp.unix.questions,comp.unix.internals,alt.unix.wizards Subject: rcp behavior Message-ID: <1990Nov5.192620.1467@nbc1.ge.com> Date: 5 Nov 90 19:26:20 GMT Reply-To: scott@nbc1.GE.COM (Scott Barman) Organization: National Broadcasting Company, Inc., New York Lines: 42 [Since net.non-rational-thinking has really made a mess of things (this is what I get for being too busy to notice), I am not sure where to post this now!] I wrote and maintaining a program that has to run on both Suns and MicroVaxes (not my choice so save your flames). To make sure sources stay the same on all machines I am using my Makefile to rcp the changed sources to the other machines. There are NFS mounts to all these machines but considering the MicroVaxes are running a brain-damaged Ultrix (no flames from DEC, I am really losing my patience with them!) and is flakey with NFS. I wrote the rule to use rcp. The Makefile looks something like: copy: source file names... -if test `hostname` = nbc1; then rcp $? other_system:~scott/src/zz; fi -if test `hostname` = other_system; then rcp $? nbc1:~scott/src/zz; fi touch copy OK, the workstation on my desk (gershwin) has my home directory NFS mounted from nbc1 (both Suns running SunOS 4.1). So gershwin:~scott/src/xx/some_file is the same as nbc1:~scott/src/xx/some_file. If I run the above on gershwin, I get the command: rcp some_file nbc1:~scott/src/zz allegedly copying the same file into itself. I did this several times before I realized what I was doing. No messages, error or otherwise. HOWEVER, it did not destroy the copy of the file--THANKFULLY! My question is why? How does rcp work so that if I mess up like above, my 8k of carefully constructed data doesn't disappear? Thanks! -- scott barman NBC Computer Imaging scott@nbc1.ge.com 30 Rockerfeller Plaza, Room 1615W {philabs,crdgw1}!nbc1!scott New York, NY 10112 +1 212/664-2787 (This does not represent any [un]official opinions of NBC or its affiliates)