doc
This commit is contained in:
parent
3c4af4a931
commit
7f7e0f4b2b
1 changed files with 17 additions and 29 deletions
46
README.md
46
README.md
|
|
@ -88,35 +88,7 @@ $ ls | bb -i '(filterv #(re-find #"reflection" %) *in*)'
|
||||||
["reflection.json"]
|
["reflection.json"]
|
||||||
```
|
```
|
||||||
|
|
||||||
Shuffle the lines of a file:
|
More examples can be found in the [gallery](#gallery).
|
||||||
|
|
||||||
``` shellsession
|
|
||||||
$ cat /tmp/test.txt
|
|
||||||
1 Hello
|
|
||||||
2 Clojure
|
|
||||||
3 Babashka
|
|
||||||
4 Goodbye
|
|
||||||
|
|
||||||
$ < /tmp/test.txt bb -io '(shuffle *in*)'
|
|
||||||
3 Babashka
|
|
||||||
2 Clojure
|
|
||||||
4 Goodbye
|
|
||||||
1 Hello
|
|
||||||
```
|
|
||||||
|
|
||||||
Find the line numbers where the word Clojure occurs using a case insensitive regex:
|
|
||||||
|
|
||||||
``` shellsession
|
|
||||||
$ cat /tmp/test.txt
|
|
||||||
foo
|
|
||||||
Clojure is nice
|
|
||||||
bar
|
|
||||||
when you're nice to clojure
|
|
||||||
|
|
||||||
$ < /tmp/test.txt bb -i '(map-indexed #(vector %1 %2) *in*))' | \
|
|
||||||
bb '(keep #f(when (re-find #"(?i)clojure" (second %)) (first %)) *in*)'
|
|
||||||
(1 3)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Test
|
## Test
|
||||||
|
|
||||||
|
|
@ -142,6 +114,22 @@ You will need leiningen and GraalVM.
|
||||||
Here's a gallery of more useful examples. Do you have a useful example? PR
|
Here's a gallery of more useful examples. Do you have a useful example? PR
|
||||||
welcome!
|
welcome!
|
||||||
|
|
||||||
|
### Shuffle the lines of a file
|
||||||
|
|
||||||
|
``` shellsession
|
||||||
|
$ cat /tmp/test.txt
|
||||||
|
1 Hello
|
||||||
|
2 Clojure
|
||||||
|
3 Babashka
|
||||||
|
4 Goodbye
|
||||||
|
|
||||||
|
$ < /tmp/test.txt bb -io '(shuffle *in*)'
|
||||||
|
3 Babashka
|
||||||
|
2 Clojure
|
||||||
|
4 Goodbye
|
||||||
|
1 Hello
|
||||||
|
```
|
||||||
|
|
||||||
### Fetch latest Github release tag
|
### Fetch latest Github release tag
|
||||||
|
|
||||||
For converting JSON to EDN, see [jet](https://github.com/borkdude/jet).
|
For converting JSON to EDN, see [jet](https://github.com/borkdude/jet).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue