udiff – Diffing files/directories

Purpose

udiff is a script that can be used to show the differences between files or directories. It is an URL-enabled version of the diff system command. Via ll.url and ll.orasql udiff supports ssh and oracle URLs.

Options

udiff supports the following options:

url1

The first URL to be compared (Note that a trailing / is required for directories).

url2

The second URL to be compared (Note that a trailing / is required for directories).

--encoding <encodingname>

The encoding name to use for decoding files (default utf-8).

--error <errorhandlingname>

Encoding error handling to use for reading text files (e.g. strict, replace, ignore, xmlcharrefreplace or backslashreplace; default replace).

-c <mode>, --color <mode>

Should the output of udiff be colored? The default auto uses coloring if stdout supports it. Valid modes are yes, no or auto.

-v <flag>, --verbose <flag>

Prints which files are compare before the comparison. When false udiff will be silent as long as no differences are detected. (Valid flag values are false, no, 0, true, yes or 1)

-r <flag>, --recursive <flag>

Compare directories recursively. (Valid flag values are false, no, 0, true, yes or 1)

-i <pattern(s)>, --include <pattern(s)>

Only compares files whose name matches one of the specified patterns.

-e <pattern(s)>, --exclude <pattern(s)>

Don’t compares files whose name matches one of the specified patterns.

--enterdir <pattern(s)>

Only enter directories whose name matches one of the specified patterns.

--skipdir <pattern(s)>

Don’t enter directories whose name matches one of the specified patterns.

-n <integer>, --context`` <integer>

How many lines of copied context to show (default 2).

-b <mode>, --blank <mode>

How to compare whitespace within lines. literal compares whitespace literally. trail ignores differences in trailing whitespace, lead ignores differences in leading whitespace, both ignores both leading and trailing whitespace and collapse collapses whitespace into a single space before comparing lines.

Examples

Compare two files:

$ udiff foo.txt bar.txt

Recursively compare two directories, but skip the .git directory:

$ udiff foo/ bar/ -r --skipdir=.git

Recursively compare two Oracle schemas:

$ udiff oracle://user1:pwd@database1  oracle://user2:pwd@database2 -r