From owner-freebsd-questions Mon May 28 5:18:51 2001 Delivered-To: freebsd-questions@freebsd.org Received: from smtp2.cybersurf.net (smtp2.cybersurf.net [209.197.145.112]) by hub.freebsd.org (Postfix) with ESMTP id 8BD0137B422 for ; Mon, 28 May 2001 05:18:47 -0700 (PDT) (envelope-from 01031149@3web.net) Received: from 3web.net ([209.197.158.184]) by smtp2.cybersurf.net (Netscape Messaging Server 4.15) with SMTP id GE1OV900.SW5 for ; Mon, 28 May 2001 06:18:45 -0600 Received: by 3web.net (EzMTS MTSAgent 1.22b Service) ; Mon, 28 May 01 06:18:10 -0600 for Received: from 3web.net (10.0.0.2) by 3web.net (EzMTS MTSSmtp 1.50 Service) ; Mon, 28 May 01 05:44:36 -0600 for Received: by mandy.rockingd.calgary.ab.ca (sSMTP sendmail emulation); Mon, 28 May 2001 05:44:31 -0600 Date: Mon, 28 May 2001 05:44:29 -0600 From: Duke Normandin <01031149@3web.net> To: Kristopher Borodiansky Cc: Freebsd Questions Subject: Re: Need help with Bash function Message-ID: <20010528054428.A84431@mandy.rockingd.calgary.ab.ca> Mail-Followup-To: Kristopher Borodiansky , Freebsd Questions References: <20010527224221.A111533@mandy.rockingd.calgary.ab.ca> <001101c0e736$9a18a310$b8690f41@funhouse> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <001101c0e736$9a18a310$b8690f41@funhouse>; from "Kristopher Borodiansky" on Mon, May 28, 2001 at 01:25:26AM X-Envelope-Receiver: 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 On Mon, May 28, 2001 at 01:25:26AM -0400, Kristopher Borodiansky wrote: > 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 Kris.... Thanks! Could you tell me what I was doing wrong with the '[ -a ~/tmp/*];' stuff? Later..... -- -duke Calgary, Alberta, Canada To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message