[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Checking if directory is empty in postrm



Chris Waters wrote:
> if [ "$(echo * .*)" = "* . .." ] ; then echo empty dir; fi

Brilliant. :-)

It has only one flaw.  *cough*

% mkdir emptydir; cd emptydir
% touch *
% if [ "$(echo * .*)" = "* . .." ] ; then echo empty dir; fi
empty dir

*evil grin*

Richard


Reply to: