SpongeBob1
Programmer
hi,
If I have a command in awk such as;
awk '/error/ { print $7}' errorlog.log
This will give me a list of all the $7 variables in the line containing 'error', now what if I wish to use the $7 variable to test the file again ( errorlog.log ), using this $7 as the input value i.e.
awk '/$7/ { print $0 }' errorlog.log
I am hoping to get back all lines where $7 occurs - I need to do this operation in my script. Does anyone have any ideas on how to achieve this? I'm sure it is simple, but I am new to awk...
If I have a command in awk such as;
awk '/error/ { print $7}' errorlog.log
This will give me a list of all the $7 variables in the line containing 'error', now what if I wish to use the $7 variable to test the file again ( errorlog.log ), using this $7 as the input value i.e.
awk '/$7/ { print $0 }' errorlog.log
I am hoping to get back all lines where $7 occurs - I need to do this operation in my script. Does anyone have any ideas on how to achieve this? I'm sure it is simple, but I am new to awk...