babashka / process

Clojure library for shelling out / spawning sub-processes
Eclipse Public License 1.0
220 stars 29 forks source link

exec arg0 should be the first (program) name by default #72

Closed borkdude closed 2 years ago

borkdude commented 2 years ago

Currently arg0 isn't set so the first argument disappears:

$ bb -e “(babashka.process/exec [\“echo\” \“ok\“])”

prints nothing

But most of the type arg0 should be equal to the program name anyway, so we can do that by default.

(proc/exec ["foo" ".."] {:arg0 "bar"})
perpen commented 2 years ago

Doesn't print nothing, it prints a newline.

user=> (require '[babashka.process :as p])
nil
user=> (p/exec ["bash" "dummy" "-c" "echo my name is $0"])
my name is dummy