Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 May 2001 05:44:29 -0600
From:      Duke Normandin <01031149@3web.net>
To:        Kristopher Borodiansky <elit@home.com>
Cc:        Freebsd Questions <freebsd-questions@freebsd.org>
Subject:   Re: Need help with Bash function
Message-ID:  <20010528054428.A84431@mandy.rockingd.calgary.ab.ca>
In-Reply-To: <001101c0e736$9a18a310$b8690f41@funhouse>; from "Kristopher Borodiansky" on Mon, May 28, 2001 at 01:25:26AM
References:  <20010527224221.A111533@mandy.rockingd.calgary.ab.ca> <001101c0e736$9a18a310$b8690f41@funhouse>

next in thread | previous in thread | raw e-mail | index | archive | help

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" <freebsd-questions@FreeBSD.ORG>
> 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




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