[Novalug] substrings FQDN names in bash scripting

Jon LaBadie novalugml@jgcomp.com
Tue Mar 3 15:32:20 EST 2009


On Tue, Mar 03, 2009 at 07:41:27PM +0000, Miguel Gonzalez wrote:
> 
> Dear all,
> 
>  It's driving me nuts...
> 
>  I'm trying to short a list of servers which comprises short and FQDN server so all of them are converted to hostnames so if i have:
> 
>  server1.domain.com
>  server2
>  server3.domain.com
> 
>  I convert them all into:
> 
>  server1
>  server2
>  server3
> 
>  I have a $i variable that iterates the list of servers.
> 
>  I was trying something like:
> 
>  echo ${"$i":echo `expr match "Si" '.*'`}

Lots of problems with that construction.

> 
>  but it doesn't work.
> 

"commands_generating_your_list" |
sed -e 's/\..*//'


-- 
Jon H. LaBadie                  jon@jgcomp.com
 JG Computing
 12027 Creekbend Drive		(703) 787-0884
 Reston, VA  20194		(703) 787-0922 (fax)



More information about the Novalug mailing list