rcp behavior

Scott Barman scott at nbc1.ge.com
Tue Nov 6 06:26:20 AEST 1990


[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 at 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)



More information about the Comp.unix.internals mailing list