(bash) dirname/basename with variable expansion
This commit is contained in:
+3
-6
@@ -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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user