M BUZZ CRAZE NEWS
// news

Exit code "1" on diff command despite getting output

By Joseph Russell
user@mbp$ diff --suppress-common-lines -y file1.txt file2.txt

Some output

user@mbp$ echo $?
1
user@mbp$

I'm curious why it throws exit code 1 rather 0 if its giving me what I need?

I realize this is more of a shell in general question rather than ubuntu.

1

1 Answer

a quick reading of the diff man pages showed me that the exit codes are different than what I was thinking.

Exit code 1 = differences were found.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy