I have the following:
_shellScript = "../Dependency/test.sh"
exec 'sh #{_shellScript}'
But when I go to execute the ruby script it ends me up at a shell prompt instead of executing the script that is located within the variable _shellScript.
Any ideas would be appreciated!
In Ruby, exec
ends the Ruby process and passes the shell to the child specified. If you need to give all of test.sh
's output to your console, you want system("sh #{_shellScript}")
. If you need to give data and receive it through stdin and stdout, look at popen
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With