2025-03-14 21:59:59 -06:00
|
|
|
# bb
|
|
|
|
|
|
|
|
|
|
> Native Clojure interpreter for scripting.
|
|
|
|
|
> More information: <https://book.babashka.org/#usage>.
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
- Evaluate an expression:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`bb {{[-e|--eval]}} "(+ 1 2 3)"`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
- Evaluate a script file:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`bb {{[-f|--file]}} {{path/to/script.clj}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Bind [i]nput to a sequence of lines from `stdin`:
|
|
|
|
|
|
|
|
|
|
`printf "first\nsecond" | bb -i "(map clojure.string/capitalize *input*)"`
|
|
|
|
|
|
|
|
|
|
- Bind [I]nput to a sequence of EDN (Extensible Data Notation) values from `stdin`:
|
|
|
|
|
|
|
|
|
|
`echo "{:key 'val}" | bb -I "(:key (first *input*))"`
|