Start replacing lane with terminal commands

I would like to write a shell script to run a lein replica, and then provide some commands, while preserving the replacement.

For example, I can do the equivalent:

lein repl (dev) (setup) 

I can connect to the replica using echo "(dev)\n(setup)" | lein repl echo "(dev)\n(setup)" | lein repl , but after that the completion of the replacement is completed.

Is there a way around this or another replica launcher and issuing commands from a shell script?

+6
source share
1 answer
 (echo "(println :hello)"; cat <&0) | lein repl 

This outputs a command - letting the REPL process do this, and then "switch back" to stdin for input. You may need to abort the cat call after exiting the REPL.

+8
source

Source: https://habr.com/ru/post/957037/


All Articles