Weird scenario with Awk

Guys, this one is rather odd. I've got an array of numbers, and I'm trying to select only the records with the string "Random" in the 4th column. I'm using awk in this format:

awk '{ if (( $6 -eq Random )) print $0 }'

For some odd reason, this is simply giving me the list of all the entries in my file. Can anyone help?

Thanks
Khoom

Sorted!
awk '{ if (( $6 == "Random" )) print $0 }'

thanks y'all

Khoom

you had mentioned it as 4th column and making use of $6 in awk command.

Typo ? :slight_smile:

if this is just want you want, then it can be shortened

awk '$6=="Random"' "file"

$6 exactly random

awk '$6=="Random" {print}'

$6 contain random

awk '$6~/Random/ {print}'

have a nice day :slight_smile: