I want to read the variables and the values from the txt file and compare these values with the ones computed by script.
for ex:
say var.txt contains the variable names and their values:
one 1
two 2
three 3
The value of variables "one" "two" and "three" will be computed in the script also. i want to compare the values read from var.txt and values computed in the script and check if thy are equal.
Basically, I have values in a file as expected_output. These values are the sizes of the diff sections of the elf file.
And if the application is build with a particular option then i expect there should not be any changes to the sizes of some sections.
so i want to compare the expected output values with one i get after rebuilding the application.
I have got the solution:
But I wonder if there is any option which compares two hex values ( as readelf produces hex numbers but with no 0x prefix).
I have used "let "sec_size_hex=0x$sec_size" before doing the comparison.