docs: update
This commit is contained in:
7
.travis.yml
Normal file
7
.travis.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
language: bash
|
||||||
|
|
||||||
|
os:
|
||||||
|
- linux
|
||||||
|
|
||||||
|
script:
|
||||||
|
- shellcheck <(awk '/```sh/{f=1;next}/```/{f=0}f' README.md)
|
||||||
12
README.md
12
README.md
@@ -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))
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user