Path: utzoo!attcan!uunet!cbmvax!ditto From: ditto@cbmvax.UUCP (Michael "Ford" Ditto) Newsgroups: comp.bugs.sys5 Subject: Re: compressdir bug? Keywords: sh /bin/test test missing Message-ID: <4747@cbmvax.UUCP> Date: 15 Sep 88 23:00:39 GMT References: <303@hawkmoon.MN.ORG> <442@gt-ford.gtisqr.UUCP> <318@hawkmoon.MN.ORG> <450@gt-ford.gtisqr.UUCP> Reply-To: ditto@cbmvax.UUCP (Michael "Ford" Ditto) Organization: Commodore Technology, West Chester, PA Lines: 32 In article <450@gt-ford.gtisqr.UUCP> uw-nsr!uw-warp!gtisqr!stu@beaver.cs.washington.edu (Stu Donaldson) writes: >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 This script will not work correctly with arguments that are empty or contain special characters. (For example: if /bin/test "$foo" = ""; then exit; fi would not work because the $* would expand to only "$foo ="). Use of "$@" instead of $* fixes this, and here's another way of implementing the /bin/test script: [ "$@" ] Yes, that's right, just that one line will do it. -- -=] Ford [=- . . (In Real Life: Mike Ditto) . : , ford@kenobi.cts.com This space under construction, ...!ucsd!elgar!ford pardon our dust. ditto@cbmvax.commodore.com