Skip site navigation (1)Skip section navigation (2)
Date:      06 May 1997 00:45:28 +0200
From:      Wolfram Schneider <wosch@apfel.de>
To:        Zahemszky Gabor <zgabor@CoDe.hu>
Cc:        freebsd-questions@freebsd.org (FreeBSD questions)
Subject:   Re: test -f $shvar
Message-ID:  <p1iohap5yif.fsf@campa.panke.de>
In-Reply-To: Zahemszky Gabor's message of Mon, 5 May 1997 10:27:06 %2B0200 (MET DST)
References:  <199705050827.KAA00520@CoDe.hu>

next in thread | previous in thread | raw e-mail | index | archive | help
Zahemszky Gabor <zgabor@CoDe.hu> writes:
> > The programmer must check if the variable `shvar' is
> > not empty. E.g.:
> > 
> >   test -n "$shvar" -a  -f "$shvar" 
> 
> I don't know, why isn't it enough:

This was a paranoid example.

 
> test -f "$shvar"

This should work too.

> if the shvar is empty, the test is -f "", but (as I know) I cannot have a
> file with null-length name, so it will be false.

-- 
Wolfram Schneider    <wosch@apfel.de>    http://www.apfel.de/~wosch/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p1iohap5yif.fsf>