![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Help! How to compare two lines in a file | sabertooth2000 | Shell Programming and Scripting | 3 | 04-23-2008 01:26 AM |
| replacing new lines in all files of a directory containing old lines | rooster005 | Shell Programming and Scripting | 1 | 03-25-2008 03:38 PM |
| awk to compare lines of two files and print output on screen | chlfc | Shell Programming and Scripting | 3 | 03-24-2008 04:16 AM |
| How to delete first 5 lines and last five lines in all text files | ragavendran31 | Shell Programming and Scripting | 10 | 02-21-2008 07:58 AM |
| compare files by lines and columns | giviut | Shell Programming and Scripting | 4 | 01-17-2008 06:00 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Trying to compare lines in 2 files
Hello, I am new to scripting and need some help. In looking at other posts on this forum, I came up with the following logic. I cannot figure out why I am getting names of files of the current directory in my echo output.
Scenario: message file has a line containing the version. Version.txt contains the correct version. I have to see if the message file's version matches the correct version. Can you tell me what I am doing wrong?? cat /home/brdholman/testing/Tar/Message.dat | while read LINE do #if [[ "$LINE" = "$Version.txt" ]] VERSION="$LINE" cat Version.txt | while read LINE2 do if [[ "$LINE2" = "$VERSION" ]] then echo $VERSION else continue #echo not equal fi done done |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|