Thursday, May 12, 2011

diff two commands

Sometimes it's useful to grep a piece of a file, or tail the end, and compare that with a piece of another file.

The syntax is:
diff <(command1) <(command2)

For example,
diff <(grep float myCode1.C) <(grep float myCode2.C)
Will diff the outputs of the respective commands
grep float myCode1.C and grep float myCode2.C

Adding pdfs at the command line

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf