I need to shortlist the logs between the particular timestamps.
I can achieve it by using the below command.
awk '$a>="Feb 5 10:44:*" && $a<="Feb 5 10:54*"' /var/log/xxxx
But it's not working in script.
Do I need to assign or mention anything for the variable $a
in the script?
The script which I used is:
#!/bin/bash#LOG_FILE= "/var/log/messages"read START_TIMEread END_TIME#Using AWKawk '$a>= "$START_TIME" && $a<= "$END_TIME"' /var/log/messages
Thanks in advance.