summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlist-files.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/list-files.sh b/list-files.sh
index ca1e2e7..7cd6019 100755
--- a/list-files.sh
+++ b/list-files.sh
@@ -7,9 +7,10 @@ norel) names='-name exec -o -name dyn' ;;
esac
shift
-[ $# -gt 0 ] || set .
+depth=1
+[ $# -gt 0 ] || { depth=2; set .; }
-find "$@" -mindepth 2 -maxdepth 2 \( $names \) ! -size 0 -print |
+find "$@" -mindepth $depth -maxdepth $depth \( $names \) ! -size 0 -print |
while read f; do
f="${f#./}"
d="${f%/*}"