Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!haven!adm!xadmx!Kemp@DOCKMASTER.NCSC.MIL From: Kemp@DOCKMASTER.NCSC.MIL Newsgroups: comp.unix.questions Subject: Testing execute permission from csh Message-ID: <19486@adm.BRL.MIL> Date: 6 May 89 01:33:57 GMT Sender: news@adm.BRL.MIL Lines: 29 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. Obviously ls knows what the permissions are, and so does exec; if I try to run a.c, I get "Permission denied". What is wrong with my use of csh? (I am using SunOS 4.0.1, if it matters.) I finally had to solve the problem by using ls, grep, and colrm to generate the list of files to modify. Dave Kemp