I am trying a simple String comparison to filter out String values which are equal to "Time"
echo Time | awk '{ print $1 ~ !/Time/}'
output --> 0
Also,
echo 2020-02-01-04:18:17 | awk '{ print $1 ~ !/Time/}'
output --> 1
So the above behavior correct as per requirement.
But if the date in echo command exceeding 02-Feb-2020 then sometimes it's behaving incorrectly.
example, the output of all commands should be 1, but sometimes its returning 0, Could you please point why this is happening.
echo 2020-02-03-04:18:17 | awk '{ print $1 ~ !/Time/}'
output --> 1
// This is unexpected
echo 2020-02-02-04:30:09 | awk '{ print $1 ~ !/Time/}'
output --> 0
// This is unexpected
echo 2020-02-02-04:30:09 | awk '{ print $1 ~ !/Time/}'
output --> 0
echo 2020-02-02-04:30:10 | awk '{ print $1 ~ !/Time/}'
output --> 1