I have a linux config file with with format like this:
VARIABLE=5753
VARIABLE2=""
....
How would I get f.e. value of VARIABLE2 using standard linux tools or regular expressions? (I need to parse directory path from file). Thanks in advance.
You could use the source (a.k.a. .) command to load all of the variables in the file into the current shell:
$ source myfile.config
Now you have access to the values of the variables defined inside the file:
$ echo $VARIABLE
5753
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With