The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
BASH: How do I grep on a variable? (or simmilar question that makes sense) Quan Shell Programming and Scripting 4 04-23-2009 05:36 AM
Outputting formatted Result log file from old 30000 lines result log<help required> vikas.iet Shell Programming and Scripting 5 12-02-2007 10:43 PM
Simple grep - Not sure it makes sense! GNMIKE UNIX for Dummies Questions & Answers 5 10-22-2005 03:51 AM
Linux Benchmarks Makes No Sense philip_38 Linux Benchmarks 0 07-22-2005 11:29 AM
ls -R and then diff on those result vino Shell Programming and Scripting 3 02-23-2005 06:48 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-28-2009
Blackbox Blackbox is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 6
Post diff result makes no sense

Hi,

I have written a small shellscript
Imagine dbalt.txt already existed...
"
....

Code:
touch report.txt
lynx -dump "http://site.com/index.htm" > site1.txt
lynx -dump "http://site.com/index2.htm" > site2.txt
grep -E 'Nummer: |EUR' site1.txt > preis1.txt
grep -E 'Nummer: |EUR' site2.txt > preis2.txt
cat preis2.txt >> preis1.txt
cut -d: -f2 preis1.txt > db.txt
rm preis2.txt
rm preis1.txt
rm site1.txt
rm site2.txt
rm report.txt
diff  -i dbalt.txt db.txt > report.txt

rm dbalt.txt
mv db.txt dbalt.txt

"
Although the content of the 2 textfiles db.txt and dbalt.txt
didn't changed, the result of diff is like this one:

"
57,58d56
< 1661434
< EUR8.691,-
60a59,60
> 1661434
> EUR8.691,-
92a93,96
> 1652633
> EUR5.990,-
> 1592748
> EUR6.501,-
95,96d98
< 1538084
< EUR6.401,-
99,100d100
< 1652633
< EUR5.990,-
"

What the H.... should I do?

mfg,
Blackbox
  #2 (permalink)  
Old 09-29-2009
rdcwayx rdcwayx is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 290
Add below lines before diff command in your script.


Code:
dos2unix db.txt db.txt
dos2unix dbalt.txt  dbalt.txt

  #3 (permalink)  
Old 09-29-2009
Blackbox Blackbox is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 6
It doesn't Work!

The Problem even gets bigger.
Now the result is the whole file.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:46 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0