Gentoo Archives: gentoo-server

From: Ben Munat <bent@×××××.com>
To: gentoo-server@l.g.o
Subject: [gentoo-server] simple shell script
Date: Sat, 02 Apr 2005 21:17:16
Message-Id: 424F0E01.7030107@munat.com
1 Argh. I've been trying to come up with what should be a simple bash script, but I just
2 can't seem to get it right.
3
4 I'm trying to fix up my cron script that runs sa-learn. I want it to check to see if
5 there's actually any mails in the directory before running "sa-learn <my options> <my
6 missed spam dir>" and then "rm <my missed spam dir>/*".
7
8 I've gone in circles with using the "-e" test ("if [ -e $mydir'/*' ]") and just command
9 success ("if `ls $mydirwithslashstar`", etc.) and I can't seem to get it right. What's the
10 simplest way to just test if a directory is empty?
11
12 Thanks,
13
14 Ben
15 --
16 gentoo-server@g.o mailing list

Replies

Subject Author
Re: [gentoo-server] simple shell script Renzo Rosales <rrosales@×××××.com>
Re: [gentoo-server] simple shell script Christian Bricart <christian@×××××××.de>