cdiff 0.1

cdiff is shell alias to do colored diffs.

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!
send us
an update
LICENSE TYPE:
GPL (GNU General Public License) 
USER RATING:
3.5/5 11
DEVELOPED BY:
Paul Warren
HOMEPAGE:
www.ex-parrot.com
CATEGORY:
ROOT \ Utilities
cdiff is shell alias to do colored diffs.

This is a simple bash alias to give color-coded differences between two files. I originally wrote it for viewing the differences between XML files where it is desirable to be able to find the changes quickly but to view a large amount of context either side, but I now use it for viewing differences between all kinds of files.

(For the benefit of U.S. users of search engines, I will now point out that cdiff produces colored diffs. It uses the diff utility and has colors).

Usage:

Simply source cdiff into your shell. This is best achieved by copying it into .bashrc . The output of cdiff can be viewed by piping into less -R or less -r. The -R is needed to handle the colour codes.

Get cdiff or cut and paste it:

#
# cdiff: coloured diff format
#
# Paul Warren
# 12/01/2001
#

# colour for added lines (bright yellow)
diffnew=`tput setf 6``tput bold`

# colour for removed lines (bright red)
diffold=`tput setf 4``tput bold`

# colour for unchanged lines (bright black, aka dark grey)
diffsame=`tput setf 0``tput bold`

# reset - original pair, unset all attributes
reset=`tput op``tput sgr0`

alias cdiff="diff --changed-group-format='%'
--new-group-format='%>'
--old-group-format='%

Last updated on April 29th, 2008

#shell diff #colored diff #color-coded differences #shell #color #code #differences

Add your review!

SUBMIT