Subject: Re: moreutils: Please add "dirempty" command

From: Michael Stummvoll <[email-masked]>
Date: Fri, 25 Nov 2011 12:08:48 +0100

tags 385069 patch

---

From: Michael Stummvoll <[email-masked]>
Date: Fri, 25 Nov 2011 12:06:57 +0100

Package: moreutils
Version: 0.45
Followup-For: Bug #385069

Hi,
cause there didn't happen something to this topic for some years i just made a beginning. :)

Greetings,
Michael

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (700, 'testing'), (650, 'unstable'), (600, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.1.0-1-686-pae (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages moreutils depends on:
ii  libc6            2.13-21 
ii  libipc-run-perl  0.90-1  
ii  perl             5.14.2-5

moreutils recommends no packages.

Versions of packages moreutils suggests:
ii  libtime-duration-perl  <none>  
ii  libtimedate-perl       1.2000-1

-- no debconf information

---

From: マダンテ <[email-masked]>
Date: Thu, 16 Sep 2021 02:06:11 +0900

On Mon, 28 Aug 2006 22:31:35 +0200 Erich Schubert <[email-masked]> 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')
> Kernel: Linux 2.6.17.7
> Locale: LANG=de_DE.UTF-8@euro, LC_CTYPE=de_DE.UTF-8@euro (charmap=UTF-8)
>
> ii  libc6                        2.3.6.ds1-4 GNU C Library: Shared
libraries
> ii  perl                         5.8.8-6.1   Larry Wall's Practical
Extraction