[CentOS] Need help with awk one-liner
Sean Carolan
scarolan at gmail.comWed Jul 9 17:03:26 UTC 2008
- Previous message: [CentOS] Need help with awk one-liner
- Next message: [CentOS] Need help with awk one-liner
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>> 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"}' $x | sed 's/.*\/\(.*\):.*/\1/' That worked well. If I have three matches from the awk command, how would you alter this so sed will output all three hostnames?
- Previous message: [CentOS] Need help with awk one-liner
- Next message: [CentOS] Need help with awk one-liner
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list