docs: update

This commit is contained in:
Dylan Araps
2018-06-14 17:50:46 +10:00
parent 171105b9fb
commit d7193d06ef
2 changed files with 17 additions and 2 deletions

7
.travis.yml Normal file
View File

@@ -0,0 +1,7 @@
language: bash
os:
- linux
script:
- shellcheck <(awk '/```sh/{f=1;next}/```/{f=0}f' README.md)

View File

@@ -243,7 +243,11 @@ again.
```sh ```sh
arr=(a b c d) arr=(a b c d)
printf '%s\n' "${arr[$((i==${#arr[@]}-1?i=0:++i))]}"
cycle() {
printf '%s ' "${arr[${i:=0}]}"
((i=i>=${#arr[@]}-1?0:++i))
}
``` ```
@@ -253,7 +257,11 @@ This works the same as above, this is just a different use case.
```sh ```sh
arr=(true false) arr=(true false)
printf '%s\n' "${arr[$((i==${#arr[@]}-1?i=0:++i))]}"
cycle() {
printf '%s ' "${arr[${i:=0}]}"
((i=i>=${#arr[@]}-1?0:++i))
}
``` ```