In a bash shell program, I'm capturing the 'i2cdetect -y 1' into a string (or, at least I think I am...):
i2cdetect -y 1 > i2cdetect_string
I'm able to use awk and parse through the string for specific information so, I know it's there.
However, if I try to get it's length:
echo "The i2cdetect_string length is: ${#i2cdetect_string}"
I get a 0 result!
I also tried:
echo "The i2cdetect_string length is: ${#i2cdetect_string[@]}"
thinking it may be an array but, that didn't work.
What's going on here? Are there special characters in the i2cdetect string that confuse the length capture algorithm?
Thanks for any help - or insight - provided.