Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!ux1.cso.uiuc.edu!mp.cs.niu.edu!rickert From: rickert@mp.cs.niu.edu (Neil Rickert) Newsgroups: comp.unix.shell Subject: Re: How to do file | hold file Message-ID: <1990Sep9.140057.15833@mp.cs.niu.edu> Date: 9 Sep 90 14:00:57 GMT References: <2274@ns-mx.uiowa.edu> <1215@tardis.Tymnet.COM> <8029:Sep903:04:5390@kramden.acf.nyu.edu> Organization: Northern Illinois University Lines: 15 In article <8029:Sep903:04:5390@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: >(I think cp foo bar should work like ( rm -f bar; cat > bar ) < foo, so >that other links to bar won't be affected; but POSIX 1003.2 apparently >disagrees and has cp foo bar work like cat < foo > bar. Oh, well.) > Please don't ever implement 'cp' in the way you suggest. Doing so would change file ownership, group, and permissions, not to mention that it would fail if the file is in directory for which you do not have write permission. It also messes up multiple links and symbolic links to the file. -- =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*= Neil W. Rickert, Computer Science Northern Illinois Univ. DeKalb, IL 60115. +1-815-753-6940