This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-13
Channels
- # aleph (3)
- # announcements (2)
- # babashka (15)
- # beginners (84)
- # biff (28)
- # calva (2)
- # cherry (1)
- # clj-kondo (24)
- # clojure (69)
- # clojure-austin (35)
- # clojure-brasil (7)
- # clojure-conj (2)
- # clojure-europe (83)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-portugal (5)
- # clojure-turkiye (2)
- # clojurescript (25)
- # css (4)
- # cursive (11)
- # data-science (26)
- # datahike (4)
- # datalevin (2)
- # emacs (19)
- # gratitude (1)
- # honeysql (1)
- # hyperfiddle (45)
- # introduce-yourself (5)
- # lsp (53)
- # malli (8)
- # mid-cities-meetup (1)
- # nrepl (19)
- # pathom (23)
- # practicalli (2)
- # proletarian (1)
- # rdf (2)
- # reagent (28)
- # releases (4)
- # shadow-cljs (11)
- # sql (13)
- # uncomplicate (6)
- # vim (7)
- # xtdb (3)
I have a question about the tokenizer in babashka/process
. I am rewriting an existing bash script, which calls a testing tool through another process. The testing tool accepts a logical expression of conditions az an argument, but the expression needs to be passed as a single parameter.
Something like: bash -c "./tester.sh --formula 'cond1 and cond2'"
Now if I call the tokenizer
or shell
command, the result looks like:
bash -c "./tester.sh --formula 'cond1 and cond2'"
["bash" "-c" "./tester.sh --formula cond1 and cond2"]
which almost what I expect: the argument after bash -c
kept together, but the single quotes are omitted for some reason. This is a problem, as the ./tester.sh
will receive cond1
, and
, and cond2
as separate parameters.
It sounds like a bug for me but Iām not sure. If I swap the quotes, then it starts working:
bash -c './tester.sh --formula "cond1 and cond2"'
["bash" "-c" "./tester.sh --formula \"cond1 and cond2\""]
Yes, that was the problem. After upgrading, it works now as expected. Thank you for your help.
BTW, I'd like to question whether the bash -c
is really important here. You're starting a copy of bash, and then telling it to run ["./tester.sh" "--formula" "cond1 and cond2"]
, but as soon as it does the execve()
to invoke that copy of tester.sh
, the copy of bash is out of the picture and having no impact on runtime behavior (other than maybe signal handling during shutdown, which it may or may not be in the path for depending on whether your particular version of bash recognizes that as a place where it can put in place implicit exec
behavior and get out of the way); why not skip the middle and execute that directly?
It does not. I used bash to have a minimal simple example. The real application uses ssh -J jumphost remote-ip "..."
Dear channel, I am trying to have bb
parse arguments for a task and therefore I added:
{:requires ([carat.vessel-mapping :as vessel-mapping])
:task (exec vessel-mapping/make-cardiodi-mapping)}
However when I run it, I get
25: nil
26: (exec vessel-mapping/make-cardiodi-mapping))) generate-carat-mapping
^--- Invalid number: 23b8cfb8
What am I doing wrong?