0

Hi this is my following code. I need to get the value through shell script which is assigned in ruby script.

#!/bin/bash

ruby <<EOM
    system <<-CMD
        export VARNAME=123
    CMD
EOM
echo "------"
echo ${VARNAME}

it is printing output as

------

Any Help?

1 Answer 1

4

You can't. A child process inherits its parent's environment, but cannot modify it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.