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