(bash) dirname/basename with variable expansion

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