<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=288233215-23052008><FONT face=Arial size=2>Not specific to
CentOS but I know you guys would be really helpful anyhow. Basically, I
have a file which has been editted in the past very similarly to the hosts file
only now I want to use it as a hosts file and need to run some fancy sed to
massage the data into shape. Currently, the data in the file is in the
form of <ip address> <tab> <short hostname>
<space> <short hostname alias>. In some cases there may
not be any aliases so the end of line would be right after the short hostname
(no space at the end either). In other cases there could be many space
separated short hostname aliases. What I have been trying to do without
success is add our domain name to the first string after the ip address and tab
character. As an example,</FONT></SPAN></DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial size=2>== Before
==</FONT></SPAN></DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial
size=2>1.1.1.1 foo</FONT></SPAN></DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial
size=2>10.10.10.10 bar bar2</FONT></SPAN></DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial
size=2>100.100.100.100 foobar foobar2
foobar3</FONT></SPAN></DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial size=2>== After
==</FONT></SPAN></DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial
size=2>1.1.1.1 foo.contoso.com</FONT></SPAN></DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial
size=2>10.10.10.10 bar.contoso.com bar2</FONT></SPAN></DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial
size=2>100.100.100.100 foobar.contoso.com foobar2
foobar3</FONT></SPAN></DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=288233215-23052008><FONT face=Arial size=2>Any advice on how to
pull this off? Thanks.</FONT></SPAN></DIV></BODY></HTML>