🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #846

Re: compressdir bug?

#846
From: Michael "Ford" Ditto
Date: Thu, 15 Sep 1988 23:00
32 lines
1355 bytes
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
Technical Details
Message-ID: <4747@cbmvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cbmvax!ditto
References: <303@hawkmoon.MN.ORG> <442@gt-ford.gtisqr.UUCP> <318@hawkmoon.MN.ORG> <450@gt-ford.gtisqr.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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