docs: update

This commit is contained in:
Dylan Araps
2018-06-13 12:54:50 +10:00
parent 68624438d5
commit b025296f1f

View File

@@ -32,6 +32,8 @@ scripts and not full blown utilities.
* [Get the number of lines in a file.](#get-the-number-of-lines-in-a-file) * [Get the number of lines in a file.](#get-the-number-of-lines-in-a-file)
* [Strings](#strings) * [Strings](#strings)
* [Get the directory name of a file path.](#get-the-directory-name-of-a-file-path) * [Get the directory name of a file path.](#get-the-directory-name-of-a-file-path)
* [Change a string to lowercase.](#change-a-string-to-lowercase)
* [Change a string to uppercase.](#change-a-string-to-uppercase)
* [Trim quotes from a string.](#trim-quotes-from-a-string) * [Trim quotes from a string.](#trim-quotes-from-a-string)
* [Arrays](#arrays) * [Arrays](#arrays)
* [Reverse an array.](#reverse-an-array) * [Reverse an array.](#reverse-an-array)
@@ -120,6 +122,28 @@ dirname() {
} }
``` ```
### Change a string to lowercase.
**NOTE:** Requires `bash` 4+
```sh
lower() {
# Usage: lower "string"
printf '%s\n' "${1,,}"
}
```
### Change a string to uppercase.
**NOTE:** Requires `bash` 4+
```sh
upper() {
# Usage: upper "string"
printf '%s\n' "${1^^}"
}
```
### Trim quotes from a string. ### Trim quotes from a string.
```sh ```sh