-1

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?

Kalle Richter
  • 8,008
  • 26
  • 77
  • 177
  • 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 Feb 23 '18 at 01:08

1 Answers1

0

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.

Kalle Richter
  • 8,008
  • 26
  • 77
  • 177