Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!blake!ogccse!littlei!omepd!merlyn From: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Newsgroups: comp.unix.questions Subject: chmod go=u-w (was Re: Testing execute permission from csh) Message-ID: <4394@omepd.UUCP> Date: 9 May 89 16:44:43 GMT References: <19486@adm.BRL.MIL> Sender: news@omepd.UUCP Reply-To: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Organization: Stonehenge; netaccess via BiiN, Hillsboro, Oregon, USA Lines: 40 In-reply-to: Kemp@DOCKMASTER.NCSC.MIL In article <19486@adm.BRL.MIL>, Kemp@DOCKMASTER writes: | I have run across a bug in either csh or my understanding of it (almost | certainly the latter). I have a directory of files that were read from | a tape with no world permissions: | | -rw-r----- root a.c | -rw-r----- root b.c | -rwxr-x--- root a.out | | I want to change all the files to have world read permission, and all | the executables to have world execute. I tried the following in csh as | root: | | # foreach f (*) | ? if -x $f chmod o+x $f | ? end | | and it selected EVERY file, not just those with execute permission. (I | actually used echo instead of chmod while testing). If I do the same | thing as a normal user, it works properly. What I do frequently in my public bin is: chmod go=u-w * which says "chmod these files for group and other to whatever it is *for me* minus the 'write'". (I put files that need to be publicly writable somewhere else.) So rw------- becomes rw-r--r-- and rwx------ becomes rwxr-xr-x, automagically. Ain't chmod fun? -- ***** PLEASE NOTE THE NEW ADDRESS ***** /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095===\ { on contract to BiiN, Hillsboro, Oregon, USA, until 14 May 1989 } { ...!uunet!tektronix!biin!merlyn } { or try after 15 May 1989 } \=Cute quote: "Welcome to Oregon... home of the California Raisins!"=/