Quantcast
Viewing all articles
Browse latest Browse all 102

AWK issue on Bash script

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.


Viewing all articles
Browse latest Browse all 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>