Re: [CentOS] Need help with awk one-liner

2008-07-10 Thread Denis
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 CentO

Re: [CentOS] Need help with awk one-liner

2008-07-10 Thread Mikael Fridh
On Wed, Jul 09, 2008 at 12:13:13PM -0500, 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 awk '/:8008\/root/ {pr

Re: [CentOS] Need help with awk one-liner

2008-07-09 Thread Sean Carolan
> If 'ajpv12://' and ':8008/root' are always going to be the same: > > awk '/:8008\/root/ {printf $3 "\t"}' $x | sed 's/ajpv12:\/\///g' | sed > 's/:8008\/root//g' > > If these change then your going to need either a more complex awk, > or more complex sed expression. > > -Ross Marvelous. Thanks

RE: [CentOS] Need help with awk one-liner

2008-07-09 Thread Ross S. W. Walker
Sean Carolan wrote: > those are supposed to be tab-separated urls, all on one line. If 'ajpv12://' and ':8008/root' are always going to be the same: awk '/:8008\/root/ {printf $3 "\t"}' $x | sed 's/ajpv12:\/\///g' | sed 's/:8008\/root//g' If these change then your going to need either a more c

Re: [CentOS] Need help with awk one-liner

2008-07-09 Thread Sean Carolan
those are supposed to be tab-separated urls, all on one line. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos

Re: [CentOS] Need help with awk one-liner

2008-07-09 Thread Sean Carolan
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@centos.org http://li

Re: [CentOS] Need help with awk one-liner

2008-07-09 Thread Sean Carolan
>> The URL that is output by the script looks something like this: >> >> ajpv12://hostname.network.company.com:8008/root >> >> Is there a way to alter the output so it only shows "hostname" by >> itself? Do I need to pipe this through awk again to clean it up? > > awk '/:8008\/root/ {printf $3 "\t

RE: [CentOS] Need help with awk one-liner

2008-07-09 Thread Ross S. W. Walker
Sean Carolan wrote: > This awk command pulls URLs from an apache config file, where $x is > the config filename. > > awk '/:8008\/root/ {printf $3 "\t"}' $x > > The URL that is output by the script looks something like this: > > ajpv12://hostname.network.company.com:8008/root > > Is there a wa