docs: update

This commit is contained in:
Dylan Araps 2019-09-19 17:16:40 +03:00
parent 6c179f7f03
commit 82c43dbdba

View file

@ -486,11 +486,11 @@ Alternative to the `dirname` command.
dirname() {
# Usage: dirname "path"
dir=${1%%/}
dir=${dir%/*}
[ "$dir" ] || dir=//
[ "${dir##*/*}" ] && dir=.
[ "${1##*/*}" ] && dir=.
printf '%s\n' "${dir%/*}"
printf '%s\n' "${dir:-/}"
}
```