Hi All,
The scenario is
I have a log file with some data related to Some IDs.
I want to grep data with those IDs and have to put it in another log file.
Also i am fetching the IDs from another log file.
Therefore i have created a loop to fetch IDs 1 by 1
and grep it, if it founds something it will write it in another log file.
But the script i have created is not working good
It is overwriting the data on the first line itself and and giving the data according to the last ID.
For your reference i am pasting my script.
#!/bin/bash
var=`cat mac1.logs`
for i in $var;
do
#grep -a -i -F "$i" EXCEPTIONS_n1_thru_n4.logs >> test_exceptions.logs
echo $i
done
Kindly help me with this.
Thanks,
Aayush