I'm trying to define environment variable for non-interactive console in Raspbian.
In theory I need to add the varaibles to ~/.bashrc or ~/.profile or /etc/bash.bashrc or /etc/profile. For example I add this line (according to the file where I added it):
export VTEMP="set on ~/.bashrc" export VTEMP="set on ~/.profile" export VTEMP="set on /etc/bash.bashrc" export VTEMP="set on /etc/profile"
If I write this lines in all files and logged via ssh, then putting the command: echo $VTEMP return: set on ~/.profile
If I go to the raspberry pi, open an LXTerminal and put these command echo $VTEMP return: set on ~/.bashrc
But if I try non-interactive remotely using ssh, writing:
ssh email@example.com "echo $VTEMP > out.txt", when I go to see the content of the file out.txt there's nothing, it empty.
Why isn't VTEMP defined when using non-interactive?