diff options
author | Dylan Araps <dylan.araps@gmail.com> | 2019-09-19 20:04:04 +0300 |
---|---|---|
committer | Dylan Araps <dylan.araps@gmail.com> | 2019-09-19 20:04:04 +0300 |
commit | ea1864fd09a2fd992bc4f7793f44289b87d63621 (patch) | |
tree | c4fa6f4c48f7fedad26ff4ba326565bdfcaf8298 | |
parent | 9e6185bb3ae96c4b7a4345b0bd31cb10659a9028 (diff) | |
download | pure-sh-bible-ea1864fd09a2fd992bc4f7793f44289b87d63621.tar.gz pure-sh-bible-ea1864fd09a2fd992bc4f7793f44289b87d63621.zip |
docs: update
-rw-r--r-- | README.md | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -512,8 +512,11 @@ Alternative to the `basename` command. ```sh basename() { # Usage: basename "path" - path=${1%/} - printf '%s\n' "${path##*/}" + dir=${1%${1##*[!/]}} + dir=${dir##*/} + dir=${dir%"$2"} + + printf '%s\n' "${dir:-/}" } ``` |