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