compressdir bug?
Michael "Ford" Ditto
ditto at cbmvax.UUCP
Fri Sep 16 09:00:39 AEST 1988
In article <450 at gt-ford.gtisqr.UUCP> uw-nsr!uw-warp!gtisqr!stu at 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 at kenobi.cts.com
This space under construction, ...!ucsd!elgar!ford
pardon our dust. ditto at cbmvax.commodore.com
More information about the Comp.bugs.sys5
mailing list