This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
ironically I quickly realized that I couldn't do that in this case, because the program also took its input from stdin
I guess in theory I could have arranged for the script to be prepended to the input and make sure the last form is one that does the work and then System/exit
s, but that sounds pretty hacky
@gfredericks I once asked for an option in here to provide a program with the -e
option, without printing expressions.
I could've but it was a ~20 line script so I felt weird putting that in an arg
Borkdude@borkdude /tmp $ echo '(println "hello")' > hello.clj
Borkdude@borkdude /tmp $ clj -e "$(cat hello.clj)"
hello
Borkdude@borkdude /tmp $
I'm not a bash lawyer yet, but I got the distinct impression yesterday that <<EOF
goes to stdin
clojure -e "$(cat << 'FOO'
(println "ta-da")
FOO
)"
You're right, I've just got on a journey learning that 🙂I've been learning some bash recently.
Weirdest thing so far is the <>
redirection operator.
same as <
except it makes stdin writable