Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!cornell!uw-beaver!tikal!sigma!uw-nsr!uw-warp!gtisqr!stu From: stu@gtisqr.UUCP (Stu Donaldson) Newsgroups: comp.bugs.sys5 Subject: Re: compressdir bug? Summary: Really /bin/test missing. Message-ID: <450@gt-ford.gtisqr.UUCP> Date: 14 Sep 88 01:59:19 GMT References: <303@hawkmoon.MN.ORG> <442@gt-ford.gtisqr.UUCP> <318@hawkmoon.MN.ORG> Reply-To: uw-nsr!uw-warp!gtisqr!stu@beaver.cs.washington.edu (Stu Donaldson) Organization: Global Tech International Inc, Mukilteo WA. Lines: 64 Sender: Followup-To: Distribution: In article <318@hawkmoon.MN.ORG> det@hawkmoon.MN.ORG (Derek E. Terveer) writes: >In article <442@gt-ford.gtisqr.UUCP>, stu@gtisqr.UUCP (Stu Donaldson) writes: >> In article <303@hawkmoon.MN.ORG>, root@hawkmoon.MN.ORG (Admin) writes: >> >> > There is a missing `!' just before the -exec in the find. > >I don't think so -- your analysis of the command is correct, however perhaps >this is a case where i may be forced to stick my foot in my mouth and wiggle my >toes vigoursly... (:-( I assumed that because it didn't seem to work on MY >system (uPort V/386 3.0-L2.2) that it was a bug. > >I any event this is why i decided to insert the "!" (before the first exec) in >my copy of compressdir: >$ ls -l /bin/test >/bin/test: No such file or directory Some time after I posted my response, I found that compressdir didn't work on another of our machines. Upon investigation, I found that /bin/test was missing. Then I recalled, that it was missing missing from the uPort System V/386 distribution, and I had created my own '/bin/test' to fix this sort of problem. I don't know if /bin/test is supposed to be there, and isn't, or if they just left it off of the V/386 release. The simple case of the problem is this: find . -exec test -r {} \; -print This will cause find to execute the command 'test -r FILENAME' for each file it finds. This will fail, because there is no command 'test'. 'test' is internal to the shell, and was apparently not placed in /bin/test. Placing a '!' in front of the exec part of the 'find' command seems to me to be definately the wrong way to solve the problem. You are relying on the exec command of 'test ...' to fail. As I said, my solution was to create /bin/test. Here is a copy, it is incredibly simple. : # /bin/test if [ $* ] then exit 0 else exit 1 fi As you can see, it relies on the test command implimented within the shell. I wonder if anyone has brought this up with microport? >derek >-- >Derek Terveer det@hawkmoon.MN.ORG > w(612)681-6986 h(612)688-0667 > >"A proper king is crowned" -- Thomas B. Costain -- Stu Donaldson UUCP: uw-beaver!uw-nsr!uw-warp!gtisqr!stu Global Tech Int'l Inc. ARPA: uw-nsr!uw-warp!gtisqr!stu@beaver.cs.washington.edu Mukilteo WA, 98275 Bell: (206) 742-9111 PS, use one of the above return addresses, the From field is probably hosed.