diff <(echo "$string1") <(echo "$string2") Example: diff <(echo "A") <(echo "B"); 1c1 < A --- > B