I want to set a variable that is shared between ALL the processes within the system.
export VAR = value
thus I make the variable visible inside the shell and its children
export VAR = value >> /root/.profile
so I make the variable visible to all the new shells I open remotely
if I start a script remotely, or at system startup, or by pressing a button on a webgui, or through a magic spell, I want that script or any other script to use the value contained in the variable.
looking on the net many people talk about "sharing" of memory, but it seems to me a cumbersome solution, I don't know if it's the right one and I don't find exhaustive documentation.
Is there a simple solution? Something I don't know (because I'm a noob) that allows me to solve by modifying a file or using a particular program?
I have been trying to resolve it for at least four hours, please help me
Depending on the earliest possible time you will need to use that variable after the router boots up, you can potentially have the declaration in /etc/rc.local.
Given that you've had 2 errors in the 2 examples you've posted, I have to say these:
Put the declaration above the exit 0 line of /etc/rc.local
No spaces around = are allowed
After you modify the /etc/rc.local make sure to run ash -n /etc/rc.local to verify it parses OK
After that reboot the router, connect to it over ssh and try echo $VAR
today i'm making a clean installation...
and now...
my script cannnot use source with this version...
I dont know what is missing and what i should install...
I'm going crazy...