aboutsummaryrefslogtreecommitdiffstats
path: root/examples/functions/emptydir
diff options
context:
space:
mode:
Diffstat (limited to 'examples/functions/emptydir')
-rw-r--r--examples/functions/emptydir28
1 files changed, 0 insertions, 28 deletions
diff --git a/examples/functions/emptydir b/examples/functions/emptydir
deleted file mode 100644
index 412af5b..0000000
--- a/examples/functions/emptydir
+++ /dev/null
@@ -1,28 +0,0 @@
-#! /bin/bash
-#
-#Derived from:
-#
-#From: damercer@mmm.com (Dan Mercer)
-#Newsgroups: comp.unix.admin,comp.unix.shell,comp.unix.programmer,comp.sys.sun.admin
-#Subject: Re: Command to find out if a directory is empty
-#Date: 17 Aug 2000 14:35:56 GMT
-#Message-ID: <8ngt8c$fmr$1@magnum.mmm.com>
-
-# usage: emptydir [dirname] ; default dirname is "."
-
-emptydir()
-{
- typeset file dir=${1:-.}
- [[ -d $dir ]] || {
- echo "$FUNCNAME: $dir is not a directory" >&2
- return 2
- }
- for file in $dir/.* $dir/*
- do
- case ${file#$dir/} in
- .|..) ;;
- \*) [[ -e $file ]];let $?;return;;
- *) return 1;;
- esac
- done
-}