Hi all,
I'm looking for help in writing a script that will extract environment variables names and values from a text file and set them in the current C-Shell using 'setenv' command. The text file has the following format:
# Comments start with # sign
VARIABLE_NAME_1 variable_value_1
VARIABLE_NAME_2 variable_value_2
I tried the following:
#!/bin/csh
awk '/^[^#]/ {print "setenv "$1" "$2}' env_variables.txt | csh
which didn't produce any errors, but also didn't set the variables.
Any help would be much appreciated.
Mickey
I'm looking for help in writing a script that will extract environment variables names and values from a text file and set them in the current C-Shell using 'setenv' command. The text file has the following format:
# Comments start with # sign
VARIABLE_NAME_1 variable_value_1
VARIABLE_NAME_2 variable_value_2
I tried the following:
#!/bin/csh
awk '/^[^#]/ {print "setenv "$1" "$2}' env_variables.txt | csh
which didn't produce any errors, but also didn't set the variables.
Any help would be much appreciated.
Mickey