Date: Mon, 28 May 2001 01:25:26 -0400 From: "Kristopher Borodiansky" <elit@home.com> To: "Duke Normandin" <01031149@3web.net>, "Freebsd Questions" <freebsd-questions@FreeBSD.ORG> Subject: Re: Need help with Bash function Message-ID: <001101c0e736$9a18a310$b8690f41@funhouse> References: <20010527224221.A111533@mandy.rockingd.calgary.ab.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
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 > > > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001101c0e736$9a18a310$b8690f41>