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
Reminds me of this question: How can you diff two pipelines in Bash?
If you are in a bash session, you could do a:
diff
with <
creating anonymous named pipes -- managed by bash -- so they are created and destroyed automatically, unlike temporary files.
So if you manage to isolate your two different string as part of a command (grep, awk, sed, ...), you can do - for instance - something like:
diff < grep string1 myFile < grep string2 myFile
(if you suppose you have in your file lines like string1=very_complicated_value
and a string2=another_long_and_complicated_value'
: without knowing the internal format of your file, I can not recommend a precise command)