This commit is contained in:
elreydetoda 2021-06-18 12:39:51 +00:00 committed by GitHub
commit 736cbc8b39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -308,7 +308,7 @@ This is an alternative to `cut`, `awk` and other tools.
```sh
split() {
# Usage: split "string" "delimiter"
IFS=$'\n' read -d "" -ra arr <<< "${1//$2/$'\n'}"
mapfile -t arr <<< "${1//$2/$'\n'}"
printf '%s\n' "${arr[@]}"
}
```