I can use herestrings to pass a string to a command, e.g.
cat <<< "This is a string"
How can I use herestrings to pass two strings to a command? How can I do something like
### not working
diff <<< "string1" "string2"
### working but overkill
echo "string1" > file1
echo "string2" > file2
diff file1 file2
diff?diff <( echo "string1" ) <( echo "string2" )will work.diffstrings? Why not[ "$string1" = "$string2" ] && echo equal || echo "not equal"?diff <<< "string 1" "string 2"is parsed as a call todiffwith a single command-line argument"string 2"and standard input bound to a"string 1"-seeding stream. It expects two command-line arguments, sees only one, and stops there, not consuming the standard input. You could actually get it to work by comparing to standard input:diff - file2 <<< "string 1"