From: Oleg Broytman Date: Wed, 3 Apr 2019 19:16:32 +0000 (+0300) Subject: Fix(audio/mk_list_recursive.sh): Fix a bug X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=6f4caff9b64f98abccf2873b6132da83e945a563;p=audio-cdr-video.git Fix(audio/mk_list_recursive.sh): Fix a bug With empty `$`` code `[ "$1" ] && cd "$1"` returns false and exits. --- 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