[comp.unix.shell] Setting

fpb@ittc.wec.com (Frank P. Bresz) (12/21/90)

Hi,
	I often have the case where I want to open up an area of a
directory to group access.  However I am using SCCS and have many files
that should remain read only.  A mindless

	chmod -R g+w .

	Trashes the sanctity of SCCS by making some things group writable
while they aren't user writable.

	How can I cleanly execute this command?

	awk/sed/sh/find (or whatever) accepted

	Please no PERL or CSH.

	SunOS4.1 (but please don't make it specific to that platform)
--
| ()  ()  () | Frank P. Bresz   | Westinghouse Electric Corporation
|  \  /\  /  | fpb@ittc.wec.com | ITTC Simulators Department
|   \/  \/   | uunet!ittc!fpb   | Those who can, do. Those who can't, simulate.
| ---------- | +1 412 733 6749  | My opinions are mine, WEC don't want 'em.

subbarao@phoenix.Princeton.EDU (Kartik Subbarao) (12/21/90)

In article <FPB.90Dec20120534@ittc.ittc.wec.com> fpb@ittc.wec.com (Frank P. Bresz) writes:
>
>Hi,
>	I often have the case where I want to open up an area of a
>directory to group access.  However I am using SCCS and have many files
>that should remain read only.  A mindless
>
>	chmod -R g+w .
>
>	Trashes the sanctity of SCCS by making some things group writable
>while they aren't user writable.
>
>	How can I cleanly execute this command?
>
>	awk/sed/sh/find (or whatever) accepted

Find seems up to this task.

To add group read & write permissions to any file here or lower that's 
writable to the user:

find . -perm -0600 -exec chmod g+rw "{}" \;



			-Kartik



--
internet# ls -alR | grep *.c
subbarao@{phoenix or gauguin}.Princeton.EDU -|Internet
kartik@silvertone.Princeton.EDU (NeXT mail)       -|	
SUBBARAO@PUCC.BITNET			          - Bitnet

fpb@ittc.wec.com (Frank P. Bresz) (12/22/90)

Yesterday I said : 


>>Hi,
>>	I often have the case where I want to open up an area of a
>>directory to group access.  However I am using SCCS and have many files
>>that should remain read only.  A mindless

>>	chmod -R g+w .

>>	Trashes the sanctity of SCCS by making some things group writable
>>while they aren't user writable.

>>	How can I cleanly execute this command?

>>	awk/sed/sh/find (or whatever) accepted

>>	Please no PERL or CSH.

>>	SunOS4.1 (but please don't make it specific to that platform)

Well the answer from Gene Spafford <spaf@cs.purdue.edu>
was the exact answer I was looking for : 

>chmod -R g=u .

>will set the group protections for all files and directories to the
>the same as the owner protections....  is that what you wanted?
>
>--spaf

	Thanks a lot Gene, for a neat concise answer.  I guess I didn't
quite get the meaning of = and the phrase :  

          The letters u, g, or o indicate that permission  is  to
          be taken from the current mode for the user-class.


This is being sent to try and stem the tidal wave of answers.
--
| ()  ()  () | Frank P. Bresz   | Westinghouse Electric Corporation
|  \  /\  /  | fpb@ittc.wec.com | ITTC Simulators Department
|   \/  \/   | uunet!ittc!fpb   | Those who can, do. Those who can't, simulate.
| ---------- | +1 412 733 6749  | My opinions are mine, WEC don't want 'em.

davidsen@sixhub.UUCP (Wm E. Davidsen Jr) (12/27/90)

In article <5389@cuuxb.ATT.COM> dmeeks@cuuxb.UUCP (David L. Meeks) writes:

| sure all arguments to 'find' are white-space separated.  I believe
| one could also use:
| 	
| 	find . -type f ! -name "s.*" ! -name "p.*" -print |xargs chmod g+w
| 
| which would also eliminate the 'p.' files from the list.

  Or ! -name '[sp].*' since these are glob format wildcards on names
(shell rules, not regular expressiln rules).
-- 
bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me