bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

diff: suboptimal behaviour with errors


From: Thomas Schwinge
Subject: diff: suboptimal behaviour with errors
Date: Thu, 18 Mar 2004 17:52:53 +0100
User-agent: Mutt/1.4.1i

Hello!

Please have a look at the following:

#v+
address@hidden:~/tmp > dd if=/dev/urandom of=1 count=7 ; dd if=/dev/urandom 
of=2 count=7
7+0 records in
7+0 records out
7+0 records in
7+0 records out
address@hidden:~/tmp > diff -u 1 2 ; echo $?
Binary files 1 and 2 differ
2
address@hidden:~/tmp > diff -u 1 nonexistent ; echo $?
diff: nonexistent: No such file or directory
2
address@hidden:~/tmp > diff -qwertz ; echo $?
diff: invalid option -- z
diff: Try `diff --help' for more information.
2
#v-

For the first run of 'diff' I can understand that it won't return '1' as
it has not been able to provide a "diff".
But I can not understand that running it against nonexistent files or
with unrecognised options will make it exit with the same return value
as above; these are totally different things.
IMHO all these three should have different return values.

Could / should this be changed in a later version of diff?


Regards,
 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]