From: Sergey Matveev Date: Tue, 29 Mar 2022 15:41:28 +0000 (+0300) Subject: Fix correct working with hierarchy of directories X-Git-Url: http://www.git.stargrave.org/?p=sgmon.git;a=commitdiff_plain;h=3056f5ff787d9215e4fa25817faed2be8ed89c23 Fix correct working with hierarchy of directories --- diff --git a/probelist.sh b/probelist.sh index 28a4eb5..6e6eca2 100755 --- a/probelist.sh +++ b/probelist.sh @@ -1,6 +1,9 @@ #!/bin/sh -e -find . -mindepth 1 -type d -not -name ".*" | while read probe ; do - [ -e $probe/run ] || continue - echo ${probe#./} -done | sort +nondot() { + find $1 -mindepth 1 -maxdepth 1 -type d -not -name ".*" | while read d ; do + [ -e $d/run ] && echo ${d#./} || nondot $d + done +} + +nondot . | sort