Input file:
2 aux003.net3.com error12
6 awn0117.net1.com error13
84 aux008 error14
29 aux001.ha.ux.isd.com error12
209 aux002.vm.ux.isd.com error34
21 alx0027.vm.net2.com error12
227 dux001.net5.com error123
22 us008.dot.net2.com error121
13 us009.net2.com error129
Expected Output:
2 aux003 error12
6 awn0117 error13
84 aux008 error14
29 aux001 error12
209 aux002 error34
21 alx0027 error12
227 dux001 error123
22 us008 error121
13 us009 error129
For now i used this:
sed -e 's/.net[1-5].com//' -e 's/.ha.ux.isd.com//'
But its not applicable for all domains, i have to put new -e on each domain.
How do we simplyfy this, so i can remove all the FQDN and just remain the hostname?