Fork me on GitHub
#babashka
<
2021-08-13
>
escherize18:08:18

the shell function that is avaliable in bb.edn ā€” Iā€™d like to use it in a bb script. is it avaliable in a library someplace?

borkdude18:08:44

@escherize yes, available as babashka.tasks/shell

dabrazhe10:08:49

@U04V15CAJ Can I use bb shell in the regular bb sripts and how to get the result instead of the process?

dabrazhe10:08:45

((juxt count identity)  (shell "ls -l")) 
is returning a java object, but i'd like the command result as a list

borkdude10:08:24

@U96LS78UV shell accepts the same options as babashka.process/process in the first position as a map. See https://github.com/babashka/process for docs. You could do: (:out (shell {:out :string} "ls -l")) to get the process output as a string

escherize18:08:02

šŸ™ thank you

borkdude18:08:16

it's basically a combination of babashka.process/process + error handling + babashka.process/tokenize

šŸ‘Œ 2
escherize20:08:40

I prefer it to clojure.java.shell/sh