On Mon, 28 Aug 2006 22:31:35 +0200 Erich Schubert <er...@debian.org> wrote:
> Package: moreutils
> Version: 0.16
> Severity: wishlist
>
> Hi,
> Testing a directory to be empty in bash is hackish, see
>
http://wooledge.org/mywiki/BashFaq#head-6ec77504553115e8518271d0d319e27148634f19
>
> The cleanest way probably is
> if [ -z "$(ls -A "$dir")" ]; then
> fi
>
> Maybe we should add a small utility which does test this in a sane way.
>
> if dirempty "$dir"; then
> fi
>
> -- System Information:
> Debian Release: testing/unstable
> APT prefers unstable
> APT policy: (500, 'unstable'), (1, 'experimental')
> Architecture: i386 (i686)
> Shell: /bin/sh linked to /bin/dash
> Kernel: Linux 2.6.17.7
> Locale: LANG=de_DE.UTF-8@euro, LC_CTYPE=de_DE.UTF-8@euro (charmap=UTF-8)
>
> Versions of packages moreutils depends on:
> ii libc6 2.3.6.ds1-4 GNU C Library: Shared
libraries
> ii perl 5.8.8-6.1 Larry Wall's Practical
Extraction
>
> moreutils recommends no packages.
>
> -- no debconf information
>
>