From 73a886aa465a45704c373c48dce4e67825183f7a Mon Sep 17 00:00:00 2001 From: kasra-dr Date: Tue, 18 Mar 2025 17:01:47 +0330 Subject: [PATCH] Fix: incorrect argument usage in Challenge 4 (of the session 9) --- challenge-eight/challenge-four.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 challenge-eight/challenge-four.sh diff --git a/challenge-eight/challenge-four.sh b/challenge-eight/challenge-four.sh old mode 100644 new mode 100755 index 8500fd8..b515be7 --- a/challenge-eight/challenge-four.sh +++ b/challenge-eight/challenge-four.sh @@ -1,7 +1,8 @@ #!/bin/bash +read -p "Please enter your direcroty path: " directory_path list_files() { - for file in $1/*; do + for file in $(ls "$1"/*); do echo $file if [[ -d $file ]]; then list_files $file @@ -9,4 +10,5 @@ list_files() { done } +list_files $directory_path