Hi guys, hopefully you can give me a hand with this before my monitor has a nasty accident!
I have the following line in a script:
awk 'int(substr($1,2,2))>'06' && int(substr($1,2,2))<'08' ' ANYOLDFILE.log
... which when ran against this data file:
[07:50:37,459] [Some stuff] [Some more stuff]
[08:13:37,459] [Some stuff] [Some more stuff]
... correctly returns:
[07:50:37,459] [Some stuff] [Some more stuff]
But I can't work out for the life of me the syntax to use a variable string instead of the values '06' and '08'. I've tried every combination I can think of but none of them work. I don't get an error, but it doesn't return any data.
Anyone know what the answer is?
Also I have been forced to ask for results between 6 and 8 because I couldn't manage to get it to do a simple check for =7, so if you know how to do that as well, you'll get a double dose of karma for the day!
Thanks in advance.