I have a text file having contents in format...
File=/opt/mgtservices/probes/logs is_SS_File=no is_Log=yes Output_File=probes_logs
This can have around 1k records. I am reading line by line from a file.
while read -r line
do
if [ $SS_SERVER -eq 0 ]
then
arr=$(echo "$line" | tr ' =' "\n")
echo $arr[1]
#do something
elif [[ $SS_SERVER -eq 1 && "$line" =~ "is_SS_File=\"no\"" ]]
then
#do something else
fi
done < "$filename"
I am expecting that arr should be an array, so that I can get output as:
arr[1]=File
arr[2]=/opt/mgtservices/probes/logs
arr[3]=is_SS_File
and so on...
Which I am not getting here. arr[1] is giving me complete line without "=" I want to use 2 delimiters "space" and "=".
SS_SERVERand where is it being set?