[CentOS] Need help with awk one-liner

Denis denis.becker at mnsu.edu
Thu Jul 10 18:06:09 UTC 2008


Sean Carolan wrote:
> The awk output that was piped into to the sed command looks like this:
>
> ajpv12://host1.domain.company.com:8008/root
> ajpv12://host2.domain.company.com:8008/root
> ajpv12://host3.domain.company.com:8008/root
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
>   
for the sample data you gave the following worked for me:

gawk  -F/  '/:8008\/root/ {split($3,hostname,".") ; print hostname[1]}'  
urls

-- 
Denis Becker
Information Technology - Engineering
MN State Univ., Mankato
Mankato, MN
ph: 507-389-5617
fx: 507-389-5002




More information about the CentOS mailing list