Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hpda!hpcupt1!hpsal2!morrell From: morrell@hpsal2.HP.COM (Michael Morrell) Newsgroups: comp.unix.questions Subject: Re: Testing execute permission from csh Message-ID: <14660010@hpsal2.HP.COM> Date: 8 May 89 22:59:39 GMT References: <19486@adm.BRL.MIL> Organization: HP System Architecture Lab, Cupertino Lines: 28 / hpsal2:comp.unix.questions / Kemp@DOCKMASTER.NCSC.MIL / 6:33 pm May 5, 1989 / 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. ---------- I think since the superuser can execute any file even if it has mode 000, csh tries to do you a favor and always returns true for "-x" if you are root (same goes for "-r" and "-w"). I don't know if I like this "feature". Michael