bb: add page (#9500)

pull/1/head
Nicholas 2022-11-18 02:52:38 +01:00 committed by GitHub
parent 4f1a010ec1
commit 724ed194a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

20
pages/common/bb.md Normal file
View File

@ -0,0 +1,20 @@
# bb
> Native Clojure interpreter for scripting.
> More information: <https://book.babashka.org/#usage>.
- [e]valuate an expression:
`bb -e "(+ 1 2 3)"`
- Evaluate a script [f]ile:
`bb -f {{path/to/script.clj}}`
- Bind input to a sequence of lines from stdin:
`printf "first\nsecond" | bb -i "(map clojure.string/capitalize *input*)"`
- Bind input to a sequence of EDN(Extensible Data Notation) values from stdin:
`echo "{:key 'val}" | bb -I "(:key (first *input*))"`