sezaru
Running a shell command when exiting an Elixir script
I have a mix task that does some stuff, and in the end it created a shell command that I want to run. The command can be something that willl require full IO support, so you can something like a psql session, an ssh session, etc.
Is there some way to run that command before/after exiting the Elixir task/beam so it is executed as a normal command in bash?
If not, is there some way that I can run that command inside the beam, but the beam give full IO handling to the process until it finishes?
Trying to doing something like this with System.cmd doesn’t seem to do the trick.
Most Liked Responses
Hermanverschooten
VictorGaiva
Why don’t you do the oposite? Call an Elixir Script from a Bash Script, and when it exits you can do anything.
You could even get the exit codes to do some logic.
sezaru
Thanks for the suggestion, but it doesn’t seem to work from my tests, it will still not give the keyboard IO control to the external program/shell








