So we have a test file that has a 3 digit number per line, several hundred lines of in the file.
I need to find a way to read from the file the number (or 3 digits that make up the number), add them together, and then determine if the resulting sum is odd or even. My current script is reading each line as a whole number, and I am missing the part where I am able to sum the digits...
while read number
do
echo $number
if [ $((number % 2)) -eq 0 ]; then
echo even
else
echo odd
fi
done < input.txt