print your variable in ruby / python script, then it can be read from the shell script using an example:
#!/bin/bash
ruby_var=$(ruby myrubyscript.rb)
python_var=$(python mypythonscript.py)
echo "$ruby_var"
echo "$python_var"
make sure that your ruby / python script prints only this variable (there are more complex ways with named pipes in the example for more interaction).
source
share