Using Ubuntu 20.04.4 LTS (Focal Fossa) diff (GNU diffutils) 3.7
From here we have:
diff a b && echo "no difference" || echo "differences!" ;
If diff a b has exit code of 0 then said differently we have a match (all ok, Success, same inputs, no difference between a b).
How to capture the result of diff with text "no difference" and use it later in the script? How to reuse result "no difference"?
Reuse result, like a screen message:
The result from diff a b = "
no difference"
Or
The result from diff a b = "
Same inputs. Match. All ok. No difference. Success."