I\'m trying to find a way to determine the difference between two strings in my script. I could easily do this with diff or comm, but I\'m not dealing with files and I\'d pr
I prefer cmp
and Process Substitution feature of bash:
$ cmp -bl <(echo -n abcda) <(echo -n aqcde)
2 142 b 161 q
5 141 a 145 e
Saying on position 2, a b occurs for the first, but a q for the second. At position 5, another difference is happening. Just replace those strings by variables, and you are done.