What is an easy way to do a sorted diff between two files?
Here's a function for it:
function diffs() {
diff "${@:3}" <(sort "$1") <(sort "$2")
}
Call it like this:
diffs file1 file2 [other diff args, e.g. -y]
Presumably you could alter it as per David Schmitt's answer if necessary.
This redirection syntax is bash specific. Thus it won't work in tcsh.
You can call bash and specify the command directly:
bash -c 'diff <(sort text2) <(sort text1)'