From 3056f5ff787d9215e4fa25817faed2be8ed89c23 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 29 Mar 2022 18:41:28 +0300 Subject: [PATCH] Fix correct working with hierarchy of directories --- probelist.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 -- 2.44.0