I am trying to get clean the file having domain names but they are not FQND (fully qualified domain names).
I have tried this script, but it is damn slow (For only 3 inputs taking more than 30 seconds):
for h in "bert" "ernie" "www.google.com" do host $h 2>&1 > /dev/null if [ $? -eq 0 ] then echo "$h is a FQDN" else echo "$h is not a FQDN" fi done
The input what I am trying to give is a big file containing the following:
example.com examplecom.de example1.com .com Silverplate.ss.com
Where output should be only:
Hope the idea is clear. Can it be done with some sed, awk, or other scripting used by Ubuntu 16.04?