1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 23:02:07 +02:00
tldr/pages/common/bb.md
4G3NT 87ec0727fc
pages*: add backticks to every io stream (#10442)
* pages*: add backticks to every io stream
2023-07-02 18:42:01 +05:30

481 B

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*))"