I have a list of domains matched and piped in through grep with various length but all match the last three records. I'm trying to output all of the non-qualified sub-domains.
I have:
awk -F'.' -v OFS='.' '{$(NF-3)=$(NF-2)=$(NF-1)=""; print $0}'
my output leaves trailing ...... on the output
Thanks
{print $0}
is the default behaviour of awk, so you can write a true condition instead:1
will do the same. Also,{print}
is the same as{print $0}
, so you can omit the reference to$0
.