Shell script to read value from a file and compare it to another one
- by maneeshshetty
I have a C program which puts one unique value inside a test file (it would be a two digit number). Now I want to run a shell script to read that number and then compare with my required number (e.g. 40).
The comparison should deliver "equal to" or "greater".
For example: The output of the C program is written into the file called c.txt with the value 36, and I want to compare it with the number 40.
So I want that comparison to be "equal to" or "greater" and then echo the value "equal" or "greater".