(bash) dirname/basename with variable expansion

This commit is contained in:
scbj committed 2026-06-01 09:30:21 +02:00
1 parent 607543767b
commit 4cf6c18b81
1 file changed
+3 -6
+3 -6
View File
@@ -1,9 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
IFS=$'\n' path="$(realpath "${BASH_SOURCE}")"
array=($(find . -mindepth 1 -maxdepth 1 -type d))
unset IFS
for item in "${array[@]}"; do echo "path: ${path%/*}"
echo "[ ${item} ]" echo "file: ${path##*/}"
done