[PLUG] Bash file test for multiple files

Paul Heinlein heinlein at madboa.com
Fri Feb 11 17:26:55 UTC 2011


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 <> heinlein at madboa.com <> http://www.madboa.com/



More information about the PLUG mailing list