1

I want to use my own specific variable KILL, but I can't find a way to make it visible for non-terminal session.

By now I tried to add KILL=0 and export KILL=0 to ~/.profile, but that doesn't seem to work (when I tried to echo KILL into some txt file, it showed empty lines only, example - echo $KILL >> test.txt).

What should I do to make my variable visible for non-terminal sessions?

1 Answer 1

1

On Linux, using Bash, you will need to put the variable into ~/.bash_profile. Then it will be available when you open a new terminal where you would launch echo $KILL. After you re-login, it should be available to any process you launch even outside terminal as long as it's going to try to use it.

The variable can be also put in /etc/profile (to be set for all users) or /etc/environment (to be set for all users and processes started by the system).

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

1 Comment

It finally worked, after placing variable to /etc/environment thanks

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.