The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Compare two files
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Compare two files
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
10-08-2008
amir07
Registered User
Join Date: Feb 2007
Posts: 37
Thanks.,
This approach works, what do you think:
#!/bin/ksh
while read myline
do
cnt=0
while read line
do
if [[ "$myline" = "$line" ]]
then
((cnt+=1))
break
fi
done < file1
if [[ $cnt -eq 0 ]]
then
echo "$myline" >> output.file
fi
done < file2
amir07
View Public Profile
Find all posts by amir07
Find amir07's past nominations received
Find amir07's present nominations given