Re: getting multiple line matches to single line for gcc --version
by gazelle@[EMAIL PROTECTED]
(Kenny McCormack)
Mar 13, 2008 at 04:39 PM
In article
<225d624e-bece-45bf-afcf-afc4dac25760@[EMAIL PROTECTED]
>,
Jeff <jeep@[EMAIL PROTECTED]
> wrote:
>Im trying to use awk to extract the version of gcc in a makefile,
>but for now Im trying it on the command line to get it to work.
>
>Since the output of gcc --version is multiline, Im getting $3 of every
>line:
>
>4.1.2
>2006
>free
>even
>
>for this: gcc --version | awk '{print $3}'
gcc --version | awk '{print $3;exit}'