docs: update

This commit is contained in:
Dylan Araps
2019-09-19 18:43:16 +03:00
parent 300a0fe11e
commit 968a1bd80f
4 changed files with 23 additions and 2 deletions

View File

@@ -9,7 +9,8 @@ Alternative to the `dirname` command.
```sh
dirname() {
# Usage: dirname "path"
dir=${1%%/}
dir=${1:-.}
dir=${dir%%${dir##*[!/]}}
[[ "${dir##*/*}" ]] && dir=.
dir=${dir%/*}