First of all, let me state that I am very new to Bash scripting. I have tried to look for solutions for my problem, but couldn't find any that worked for me.
Let's assume I want to use bash to parse a file that looks like the following:
variable1 = value1 variable2 = value2 I split the file line by line using the following code:
cat /path/to/my.file | while read line; do echo $line done From the $line variable I want to create an array that I want to split using = as a delimiter, so that I will be able to get the variable names and values from the array like so:
$array[0] #variable1 $array[1] #value1 What would be the best way to do this?