Rewrite:
Compare the values in file1
and file2
and display the value
and id
lines from file2
if they do not match.
The expected output:
value: line10
id: 22
value: line14
id: 8
Failed Attempt:
#!/usr/bin/bash
for all in "$(cat file1)"
do
for ids in "$(cat file2 | grep value | awk {'print $2'})"
do
if [ "$all" != "$ids" ]
then
echo "$ids"
fi
done
done