>> correct diff(1) usage: -u uses a hardcoded context of 3 while only >> -U takes an argument > > I don't think the -U is portable enough: > > | [EMAIL PROTECTED]:/u/rse > | $ /usr/bin/diff -U3 x y > | /usr/bin/diff: illegal option -- U > | usage: diff [-bitw] [-c | -e | -f | -h | -n] file1 file2 > | diff [-bitw] [-C number] file1 file2 > | diff [-bitw] [-D string] file1 file2 > | diff [-bitw] [-c | -e | -f | -h | -n] [-l] [-r] [-s] [-S name] directory1 > directory2 > > The option -u on the other hand exists everywhere AFAIK. > I agree with -u but svs used -u3 which is different.
> Where did -u3 break? > You asked for it :-) The most portable combinations are -U3 and -u using OpenPKG. The second most portable combinations are the same supporting everything but solaris8 whose operating system diff does not seem to support unified format at all. OP = OpenPKG diffutils-2.8.7-2.4.0 OS = Operating System OP-u3 OP-U3 OP-u OS-u3 OS-U3 OS-u ----- ----- ----- ----- ----- ----- rm1 ix86-solaris10 OK OK OK ERR OK OK rm2 ix86-debian3.1 ERR OK OK OK OK OK rm3 ix86-rhel4 ERR OK OK ERR OK OK rm4 ix86-solaris9 OK OK OK ERR OK OK rm5 ia64-freebsd5.4 OK OK OK OK OK OK rm6 amd64-freebsd5.4 OK OK OK OK OK OK rm7 sparc64-solaris9 OK OK OK ERR OK OK rm8 sparc64-solaris8 OK OK OK ERR ERR ERR rm9 sparc64-solaris10 OK OK OK ERR OK OK vm10 ix86-freebsd6.0 OK OK OK OK OK OK vm11 ix86-netbsd2.0.2 OK OK OK OK OK OK vm12 ix86-gentoo1.12.0 ERR OK OK ERR OK OK vm20 ix86-suse9.3 ERR OK OK ERR OK OK vm21 ix86-mandriva10.2 ERR OK OK ERR OK OK vm22 ix86-freebsd4.11 OK OK OK OK OK OK vm30 ix86-fedora4 ERR OK OK ERR OK OK vm31 ix86-suse10.0 ERR OK OK ERR OK OK vm32 ix86-freebsd7.0 OK OK OK OK OK OK First column references machine names tested in openpkg.NET which are property of OpenPKG Foundation e.V. Operating System tests used /bin/diff on ix86-solaris10, ix86-solaris9, sparc64-solaris10, sparc64-solaris8, sparc64-solaris9 Operating System tests used /usr/bin/diff on amd64-freebsd5.4, ia64-freebsd5.4, ix86-debian3.1, ix86-fedora4, ix86-freebsd4.11, ix86-freebsd6.0, ix86-freebsd7.0, ix86-gentoo1.12.0, ix86-mandriva10.2, ix86-netbsd2.0.2, ix86-rhel4, ix86-suse10.0, ix86-suse9.3 A final note on OP-u3 is that as of this writing OpenPKG uses default behavior of GNU diffutils which in turn tries to conform to the version of POSIX that is standard for the system, see [1]. [1] http://www.gnu.org/software/diffutils/manual/html_node/Standards-conformance.html#Standards%20conformance ______________________________________________________________________ The OpenPKG Project www.openpkg.org Developer Communication List openpkg-dev@openpkg.org