Попробуйте вот это.
for w in `cat $file`;
do
echo $w;
done|sort|uniq -c
С этой разницей:
diff --git a/bar b/bar
new file mode 100644
index 0000000..e69de29
diff --git a/foo b/foo
new file mode 100644
index 0000000..257cc56
--- /dev/null
+++ b/foo
@@ -0,0 +1 @@
+foo
это происходит:
$ cd /tmp/test
$ patch --forward -i foobar.patch
patching file bar
patching file foo
$ echo $?
0
$ rm bar
$ patch --dry-run --reverse --force -i foobar.patch
The next patch, when reversed, would delete the file bar,
which does not exist! Applying it anyway.
checking file bar
checking file foo
$ echo $?
0
Итак, ответ на ваш вопрос - нет.