2022-11-18 01:52:38 +00:00
|
|
|
# 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}}`
|
|
|
|
|
2024-02-19 14:13:42 +00:00
|
|
|
- Bind [i]nput to a sequence of lines from `stdin`:
|
2022-11-18 01:52:38 +00:00
|
|
|
|
|
|
|
`printf "first\nsecond" | bb -i "(map clojure.string/capitalize *input*)"`
|
|
|
|
|
2024-02-19 14:13:42 +00:00
|
|
|
- Bind [I]nput to a sequence of EDN (Extensible Data Notation) values from `stdin`:
|
2022-11-18 01:52:38 +00:00
|
|
|
|
|
|
|
`echo "{:key 'val}" | bb -I "(:key (first *input*))"`
|