Tony Sequeira wrote:
On Fri, 2006-09-22 at 19:49 +0200, Brandon Peirce wrote:
> Christopher Parker wrote:
>
> >The source of this problem was due to GAWK not parsing the parameters
> >correctly. I now have the problem that the following command
> >
> >echo "parm1 parm2" | awk '{print $1}'
> >
> >resolves to "parm1 parm2" instead of just "parm1". Has anyone seen
this
> >before, or have any suggestions as to what may have built incorrectly
prior
> >to AWK being built?
>
> That behaviour is completely correct, IMO. "parm1 parm2" is a single
> argument--that's exactly what the quotes do!
>
> I'm not sure how that fits into your build problem though. Sorry.
My LFS 6 exhibits what I believe is the correct behaviour. I believe he
should be getting parm1 unless awks FS is changed:
$ echo "parm1 parm2" | awk '{print $1}'
parm1
$ echo 'parm1 parm2' | awk '{print $1}'
parm1
$ echo parm1 parm2 | awk '{print $1}'
parm1
$ echo parm1 parm2 | awk 'BEGIN { FS=":"}{print $1}'
parm1 parm2
$
Tony's right. Sorry, I wrote without thinking properly. Awk sees "parm1
parm2"
as input, not as argument(s) and without the quotes anyway. Ignore my
previous
mail.
Brandon.
--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page