On Tue, Jun 15, 2004 at 02:23:11PM -0400, Kamaraju Kusumanchi wrote:
> I am looking for a program/script(?) which performs diff on parts of a 
> file. Say I have a file of 100 lines. How to do diff on lines between 
> 20-30, and 50-60 without writing them into separate files. Which 
> software should I learn for this? sed/awk/perl?
> 
> thanks for any ideas
> raju
> 

Only option I can think about is writing a shell script that will use
head and tail to create temporary files. something like

#!/bin/sh

head -n $2 $1 | tail -n $3 > /tmp/$1.tmp
head -n $5 $4 | tail -n $6 > /tmp/$4.tmp

diff -u /tmp/$1.tmp /tmp/$4.tmp

rm /tmp/$1.tmp /tmp/$4.tmp

> 
> -- 
> To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
> with a subject of "unsubscribe". Trouble? Contact 
> [EMAIL PROTECTED]
> 
> 
> +++++++++++++++++++++++++++++++++++++++++++
> This Mail Was Scanned By Mail-seCure System
> at the Tel-Aviv University CC.
> 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to