Open nendre opened 7 years ago
Note that
cat access.log.1 | grep -Eo "^[0-9]+.[0-9]+.[0-9]+.[0-9]+" | while read ip; do res=cat access.log.2|grep -Eo $ip; echo $res; done
cat access.log.2|grep -Eo $ip
Produce: 108.68.174.15 28.151.137.59 2.71.250.27 17.137.186.194
but it doesn't recognised valid. Probably because the lines are in different order, but the problem it doesn't require a given order.
This is invalid.
Your solution is incorrect as it prints extra blank lines.
Note that
cat access.log.1 | grep -Eo "^[0-9]+.[0-9]+.[0-9]+.[0-9]+" | while read ip; do res=
cat access.log.2|grep -Eo $ip
; echo $res; doneProduce: 108.68.174.15 28.151.137.59 2.71.250.27 17.137.186.194
but it doesn't recognised valid. Probably because the lines are in different order, but the problem it doesn't require a given order.