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
(encoding name)The encoding name to use for decoding files (default
utf-8
).--errors
(encoding error handler name)Encoding error handling to use for reading text files (e.g.
strict
,replace
,ignore
,xmlcharrefreplace
orbackslashreplace
; defaultreplace
).--color
:yes
,no
orauto
Should the output of
udiff
be colored? The defaultauto
uses coloring ifstdout
supports it.-v
,--verbose
(false
,no
,0
,true
,yes
or1
)Prints which files are compare before the comparison. Without
-v1
udiff
will be silent as long as no differences are detected.-r
,--recursive
(false
,no
,0
,true
,yes
or1
)Compare directories recursively.
-i
,--include
(pattern(s))Only compares files whose name matches one of the specified patterns.
-e
,--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
,--context
(integer)How many lines of copied context to show (default 2).
-b
,--blank
(literal
,trail
,lead
,both
orcollapse
)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 andcollapse
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