cdiff 0.1

cdiff is shell alias to do colored diffs.
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, 23:26 GMT
price:
FREE!
homepage:
www.ex-parrot.com
license type:
GPL (GNU General Public License) 
developed by:
Paul Warren
category:
ROOT \ Utilities
cdiff
Download Button

In a hurry? Add it to your Download Basket!

user rating 11

3.5/5
 

0/5

Rate it!

Add your review!

SUBMIT