daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest May 16th, 2018 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. colordiff $file1 $file2 | less -R
  2.    
  3. -R or --RAW-CONTROL-CHARS
  4.           Like -r, but only ANSI  "color"  escape  sequences  are
  5.           output in "raw" form.  Unlike -r, the screen appearance
  6.           is maintained correctly in most  cases.   ANSI  "color"
  7.           escape sequences are sequences of the form:
  8.  
  9.                ESC [ ... m
  10.  
  11.           where  the  "..."  is  zero or more color specification
  12.           characters For the purpose of keeping track  of  screen
  13.           appearance,  ANSI color escape sequences are assumed to
  14.           not move the cursor.  You  can  make  less  think  that
  15.           characters  other  than  "m"  can end ANSI color escape
  16.           sequences by setting the environment  variable  LESSAN‐
  17.           SIENDCHARS  to  the  list of characters which can end a
  18.           color escape sequence.  And you  can  make  less  think
  19.           that characters other than the standard ones may appear
  20.           between the ESC and the m by  setting  the  environment
  21.           variable  LESSANSIMIDCHARS  to  the  list of characters
  22.           which can appear.
  23.    
  24. diff a b |
  25.    perl -lpe 'if(/^</){$_ = "e[1;31m$_e[0m"}
  26.               elsif(/^>/){$_ = "e[1;34m$_e[0m"}'
  27.    
  28. diff $file1 $file2 | colordiff | less -r
  29.    
  30. diff -uw $file1 $file2 | colordiff | less -r
  31.    
  32. diff -uw $file1 $file2 | tee /dev/stderr | colordiff | less -r -F
  33.    
  34. diff -uw $file1 $file2 | colordiff | less -r -X -F
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top