aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2019-09-19 20:07:56 +0300
committerDylan Araps <dylan.araps@gmail.com>2019-09-19 20:07:56 +0300
commit3988ed31beebb99d7e9ff48a056e0976c5557fe4 (patch)
tree29bccb1a8454feaf926381c24eb8631a14d5ed28
parentea1864fd09a2fd992bc4f7793f44289b87d63621 (diff)
downloadpure-sh-bible-3988ed31beebb99d7e9ff48a056e0976c5557fe4.tar.gz
pure-sh-bible-3988ed31beebb99d7e9ff48a056e0976c5557fe4.zip
docs: update
-rw-r--r--README.md5
1 files changed, 4 insertions, 1 deletions
diff --git a/README.md b/README.md
index 638e4d5..f619ad3 100644
--- a/README.md
+++ b/README.md
@@ -511,7 +511,7 @@ Alternative to the `basename` command.
```sh
basename() {
- # Usage: basename "path"
+ # Usage: basename "path" ["suffix"]
dir=${1%${1##*[!/]}}
dir=${dir##*/}
dir=${dir%"$2"}
@@ -526,6 +526,9 @@ basename() {
$ basename ~/Pictures/Wallpapers/1.jpg
1.jpg
+$ basename ~/Pictures/Wallpapers/1.jpg .jpg
+1
+
$ basename ~/Pictures/Downloads/
Downloads
```