Hi all,
I'd like to create a script that adds some environmental variables from a file "variables" to /etc/environment
The file "variables" is of the form
Code:
#!/bin/sh
export ROOT=/opt/drivers
export ROOT2=$ROOT/S56
....
My idea was to add the "variables" file to /etc/environmental
Code:
sudo sh -c "cat variables >> /etc/environment"
The problem with this approach is that if I I get
rather than the expected
However, if from the terminal I run then if I I get the expected result
How can I solve this issue?
I could manually change the "variables" file to
Code:
#!/bin/sh
export ROOT=/opt/drivers
export ROOT2=${ROOT}/S56
....
but the "variables" file might change in the future and is not me who creates it, so I need a more "automatic solution".
Any help would be much appreciated!
Bookmarks