docs: update
This commit is contained in:
parent
3590d9b03a
commit
bb88623af1
10
README.md
10
README.md
|
@ -1101,11 +1101,13 @@ Alternative to the `basename` command.
|
||||||
```sh
|
```sh
|
||||||
basename() {
|
basename() {
|
||||||
# Usage: basename "path" ["suffix"]
|
# Usage: basename "path" ["suffix"]
|
||||||
dir=${1%${1##*[!/]}}
|
local tmp
|
||||||
dir=${dir##*/}
|
|
||||||
dir=${dir%"$2"}
|
|
||||||
|
|
||||||
printf '%s\n' "${dir:-/}"
|
tmp=${1%${1##*[!/]}}
|
||||||
|
tmp=${tmp##*/}
|
||||||
|
tmp=${tmp%"${2/$1}"}
|
||||||
|
|
||||||
|
printf '%s\n' "${tmp:-/}"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -40,11 +40,13 @@ Alternative to the `basename` command.
|
||||||
```sh
|
```sh
|
||||||
basename() {
|
basename() {
|
||||||
# Usage: basename "path" ["suffix"]
|
# Usage: basename "path" ["suffix"]
|
||||||
dir=${1%${1##*[!/]}}
|
local tmp
|
||||||
dir=${dir##*/}
|
|
||||||
dir=${dir%"$2"}
|
|
||||||
|
|
||||||
printf '%s\n' "${dir:-/}"
|
tmp=${1%${1##*[!/]}}
|
||||||
|
tmp=${tmp##*/}
|
||||||
|
tmp=${tmp%"${2/$1}"}
|
||||||
|
|
||||||
|
printf '%s\n' "${tmp:-/}"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue