I have a question about the diff command if I want a recursive directory diff but only for a specific file type, how to do that?
I tried using the exclude option but can
In case you find it convenient, you could use the following Makefile
. Just run: "make patch"
#Makefile for patches
#Exlude following file endings
SUFFIX += o
SUFFIX += so
SUFFIX += exe
SUFFIX += pdf
SUFFIX += swp
#Exlude following folders
FOLDER += bin
FOLDER += lib
FOLDER += Image
FOLDER += models
OPTIONS = Naur
patch:
rm test.patch
diff -$(OPTIONS) \
$(foreach element, $(SUFFIX) , -x '*.$(element)') \
$(foreach element, $(FOLDER) , -x '$(element)*') \
org/ new/ > test.patch
unpatch:
rm test.unpatch
diff -$(OPTIONS) \
$(foreach element, $(SUFFIX) , -x '*.$(element)') \
$(foreach element, $(FOLDER) , -x '$(element)*') \
new/ org/ > test.unpatch