Process Substitution Diff Streams
Compare two command outputs without temp files using bash process substitution with the diff command.
Code
#!/usr/bin/env bash
set -euo pipefail
diff <(sort file_a.txt) <(sort file_b.txt) \
--side-by-side \
--width=120 \
--suppress-common-lines
echo "Exit code: $?"Report a problem with this exampleOpens a pre-filled issue on GitHub.