From 6f4caff9b64f98abccf2873b6132da83e945a563 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 3 Apr 2019 22:16:32 +0300 Subject: [PATCH] Fix(audio/mk_list_recursive.sh): Fix a bug With empty `$`` code `[ "$1" ] && cd "$1"` returns false and exits. --- audio/mk_list_recursive.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/audio/mk_list_recursive.sh b/audio/mk_list_recursive.sh index 8d0260c..6f99500 100755 --- a/audio/mk_list_recursive.sh +++ b/audio/mk_list_recursive.sh @@ -3,9 +3,12 @@ . "`dirname \"$0\"`"/../set-path umask 022 -[ "$1" ] && cd "$1" || exit 1 # or just do it in current directory -start_dir="`pwd`" +if [ "$1" ]; then + cd "$1" || exit 1 + # or just do it in the current directory +fi +start_dir="`pwd`" find . -type d -print | while read dir; do cd "$dir" || exit 1 -- 2.39.5