1
votes

How can

echo "a" > a
echo "b" > a.new
diff -u a a.new > a.patch
patch -u -p1 < a.patch

fail at the diff command with return code 1 and no output?

1
Not sure if you could consider that not work. Also you would need to run "set -e" for it to "not work". Not sure how this q/a is helpful to others? - jontro

1 Answers

0
votes

diff returns 1 if differences are found (see What are the error exit values for diff? for more info on return codes) even if stdout is redirected into a file which isn't overly helpful in my point of view.