Re: [CentOS] More awk help

2009-06-25 Thread David G . Miller
Joseph L. Casale jcas...@... writes: Hey guys, Looking through my book and the web and I am not having any success returning data from a search. I need to have awk search for a string and print the first field which is no problem but now its returning two options as the input data has

Re: [CentOS] More awk help

2009-06-25 Thread Joseph L. Casale
Being an old perl hacker I have to at least suggest doing whatever you're attempting in perl. Yeah I agree but I have found myself needing to duplicate so much work moving between nix and windows that I resolve to just using UnxTools under windows so I stay with shell scripting so I can move work

Re: [CentOS] More awk help

2009-06-25 Thread Les Mikesell
David G. Miller wrote: Hey guys, Looking through my book and the web and I am not having any success returning data from a search. I need to have awk search for a string and print the first field which is no problem but now its returning two options as the input data has changed. The

Re: [CentOS] More awk help

2009-06-24 Thread Joseph L. Casale
Any ideas? Sorry, jumped the gun. I search for two strings then use a printf. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos

Re: [CentOS] More awk help

2009-06-24 Thread Stephen Harris
On Wed, Jun 24, 2009 at 10:31:21PM +, Joseph L. Casale wrote: I need to have awk search for a string and print the first field which is no problem but now its returning two options as the input data has changed. The change is reliable, I only want the first field if it ends in a regex that

Re: [CentOS] More awk help

2009-06-24 Thread Joseph L. Casale
What you've written is mostly incoherent and incomprehensible. heh, been a long day:) Actually I am using gawk /string1/ /string2/ { print substr( $1, length($1) - 1, length($1) ) } which gets me what I need, the last two characters of the first field of a specific match... Sorry vbg, jlc

Re: [CentOS] More awk help

2009-06-24 Thread Les Mikesell
Joseph L. Casale wrote: Hey guys, Looking through my book and the web and I am not having any success returning data from a search. I need to have awk search for a string and print the first field which is no problem but now its returning two options as the input data has changed. The

Re: [CentOS] More awk help

2009-06-24 Thread Stephen Harris
On Wed, Jun 24, 2009 at 11:15:10PM +, Joseph L. Casale wrote: What you've written is mostly incoherent and incomprehensible. heh, been a long day:) Actually I am using gawk /string1/ /string2/ { print substr( $1, length($1) - 1, length($1) ) } which gets me what I need, the last two