On Fri, 2003-06-27 at 09:43, Richard Crawford wrote: > Greetings, > > I have a shell script which duplicates a file and then renames the > duplicate file; the trick is that the duplicate file needs to have the > same permissions as the original file. For example: > > 1. Open file A.txt > 2. Manipulate A.txt > 3. Save A.txt as A.txt.tmp > 4. Rename A.txt.tmp to B.txt > 5. Give B.txt the same permissions as A.txt > > I assume that there is some set of variables I can look at to find various > attributes of A.txt, so that $APerm = permissions(A.txt) or something, so > I can do chmod $APerm B.txt in step 5. > > Any suggestions would be greatly appreciated! > > Sliante, > Richard S. Crawford > > http://www.mossroot.com > AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford > MSN: [EMAIL PROTECTED] > > "It is only with the heart that we see rightly; what is essential is > invisible to the eye." --Antoine de Saint Exupéry > >
How about: 1. cp -p a.txt b.txt 2. Edit b.txt 3. Save b.txt -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://www.redhat.com/mailman/listinfo/redhat-list