[CentOS] More awk help
Stephen Harris
lists at spuddy.org
Wed Jun 24 22:50:29 UTC 2009
On Wed, Jun 24, 2009 at 10:31:21PM +0000, 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 I have, and I only want what that regex matches to be
> printed. Is it possible to do this in a one liner so I don't need to
> construct an awk script?
What you've written is mostly incoherent and incomprehensible.
Free clue: provide examples of input and expected output, including examples
that will _not_ match (so no false positives occur).
I'm not sure if you simply want
awk '$1 ~ /regexp/ { print $1}'
or something more.
--
rgds
Stephen
More information about the CentOS
mailing list