From owner-freebsd-questions Sun May 27 22:22:36 2001 Delivered-To: freebsd-questions@freebsd.org Received: from femail8.sdc1.sfba.home.com (femail8.sdc1.sfba.home.com [24.0.95.88]) by hub.freebsd.org (Postfix) with ESMTP id 09A6037B422 for ; Sun, 27 May 2001 22:22:34 -0700 (PDT) (envelope-from elit@home.com) Received: from funhouse ([65.15.105.184]) by femail8.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with SMTP id <20010528052233.HWVK17598.femail8.sdc1.sfba.home.com@funhouse>; Sun, 27 May 2001 22:22:33 -0700 Message-ID: <001101c0e736$9a18a310$b8690f41@funhouse> From: "Kristopher Borodiansky" To: "Duke Normandin" <01031149@3web.net>, "Freebsd Questions" References: <20010527224221.A111533@mandy.rockingd.calgary.ab.ca> Subject: Re: Need help with Bash function Date: Mon, 28 May 2001 01:25:26 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi Duke, Try this in your .bash_profile : function ezq () { if test -a ~/tmp/*;then echo "There's something here.";else echo "Empty."; fi;} echo by default will newline unless -n is specified such as: echo -n "Text to echo" Hope that helps. Regards, Kris ----- Original Message ----- From: "Duke Normandin" <01031149@3web.net> To: "Freebsd Questions" Sent: Monday, May 28, 2001 12:42 AM Subject: Need help with Bash function > > I'm trying to debug the following function w/o much success. > > function ezq() { > if [ -a ~/tmp/* ]; then > echo -e "there's something here....\n" > else > echo -e "empty....\n" > fi > } > I keep on getting: > > '[: binary operator expected' > > Is it whinning about the '-a' above? Why? > > All I want to do is to check to see if a directory is empty or not. > TIA... > -- > -duke > Calgary, Alberta, Canada > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message