From owner-freebsd-questions Mon May 5 16:06:10 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id QAA26505 for questions-outgoing; Mon, 5 May 1997 16:06:10 -0700 (PDT) Received: from bsd.fs.bauing.th-darmstadt.de (bsd.fs.bauing.th-darmstadt.de [130.83.63.241]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id QAA26500 for ; Mon, 5 May 1997 16:06:05 -0700 (PDT) Received: from campa.panke.de (anonymous227.ppp.cs.tu-berlin.de [130.149.17.227]) by bsd.fs.bauing.th-darmstadt.de (8.8.5/8.8.5) with ESMTP id BAA23941; Tue, 6 May 1997 01:06:02 +0200 (MET DST) Received: (from wosch@localhost) by campa.panke.de (8.8.5/8.6.12) id AAA00875; Tue, 6 May 1997 00:45:31 +0200 (MET DST) To: Zahemszky Gabor Cc: freebsd-questions@freebsd.org (FreeBSD questions) Subject: Re: test -f $shvar References: <199705050827.KAA00520@CoDe.hu> From: Wolfram Schneider Date: 06 May 1997 00:45:28 +0200 In-Reply-To: Zahemszky Gabor's message of Mon, 5 May 1997 10:27:06 +0200 (MET DST) Message-ID: Lines: 20 Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Zahemszky Gabor 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 http://www.apfel.de/~wosch/