You can read variable values from text file which are stored in key/value format inside your shell script using following command
myKeyValuePairs.txt
Sample shell script
Output:
myKeyValuePairs.txt
key1=Hello
key2=World
Sample shell script
while read -r line; do declare $line; done < myKeyValuePairs.txt
echo $key1
echo $key2
Output:
Hello
World
No comments:
Post a Comment