From 6ca4888d0504556f9226fc5aa891b9dc890bc7e9 Mon Sep 17 00:00:00 2001 From: Haffel Date: Tue, 9 Sep 2025 11:58:46 +0200 Subject: [PATCH] fix path selection --- print-all-files-and-folders.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/print-all-files-and-folders.md b/print-all-files-and-folders.md index f631697..e09738b 100644 --- a/print-all-files-and-folders.md +++ b/print-all-files-and-folders.md @@ -11,7 +11,7 @@ OUTPUT_FILE="directory_contents.txt" echo "Listing all files and folders in current dir" -for item in /*; do +for item in *; do if [ -f "$item" ]; then echo "$(basename "$item")" >> "$OUTPUT_FILE" elif [ -d "$item" ]; then @@ -31,7 +31,7 @@ echo "Contents have been written to $OUTPUT_FILE." echo "Listing all files and folders in current dir" -for item in /*; do +for item in *; do if [ -f "$item" ]; then echo "$(basename "$item")" elif [ -d "$item" ]; then