On some workstations (Debian & Ubuntu) and on a server (CentOS) I need environment variables for some scripts and jobs. What I did was altering ~/.profile
:
SOMEVARIABLE=/some/custom/path
...
Is this common practice? Are there any side effects I need to know about? Or is this solution fine & stable? Especially on the server I need this to work reliably.
I used ~/.profile
because the scripts are always executed via job-specific users without sudo rights - so I thought user-specific environment variables would be appropriate?!
EDIT:
Since the paths differ on the machines and we're talking about more than one or two variables passing the variables as parameters to the scripts wouldn't be a nice solution and hardcoding them into the scrips would require me to update it manually for every machine. That's why I wanted environment variables.