Goal: to execute a block if one or more files exists
bash file test -e will tell you if a single file exists but
if [ -e ~/Maildir/.aspambin/cur/* ]; then
will croak with too many arguments if there is more than one file
conversly a construct like
for S in ~/Maildir/.aspambin/cur/*
will
Here's what I use:
DIRTOTAL=`ls $PATH | grep [^*$] -c`
if [ $DIRTOTAL -ne 0 ]; then
-Alex
On Feb 11, 2011, at 6:14 AM, Michael Rasmussen mich...@jamhome.us wrote:
Goal: to execute a block if one or more files exists
bash file test -e will tell you if a single file exists but
if [ -e
Alex Young wrote:
Here's what I use:
DIRTOTAL=`ls $PATH | grep [^*$] -c`
if [ $DIRTOTAL -ne 0 ];
then
That works.
On Feb 11, 2011, at 6:14 AM,
Michael Rasmussen mich...@jamhome.us wrote:
Goal:
to execute a block if one or more files exists
bash file
test -e will tell you if a
On Fri, 11 Feb 2011, Alex Young wrote:
Here's what I use:
DIRTOTAL=`ls $PATH | grep [^*$] -c`
if [ $DIRTOTAL -ne 0 ]; then
if test $(find $DIR -type f | wc -l) -gt 0; then
# whatever
fi
--
Paul Heinlein heinl...@madboa.com http://www.madboa.com/