bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: might be a bug in gawk


From: Pierre Gaston
Subject: Re: might be a bug in gawk
Date: Thu, 26 Mar 2009 09:07:41 +0200

On Wed, Mar 25, 2009 at 5:58 AM, joanes.polus <address@hidden>wrote:

> hello,
>
>   execution of:
>
>   echo "a%28b%29%c"|awk -F "a" '{printf $2}'
>
>   give this result:
>
>   %28b%c
>
>   and not
>
>   %28b%29%c
>
>   So may be a bug or i do not understand something in awk.
>
> Bye.
>
>
>
> -----------------------------------------------------------------------------------
> System:
>   Archlinux 2008
>
> Hardware:
>   Linux 2.6.28-ARCH
>   i686 AMD Athlon(tm) XP 2800+ AuthenticAMD GNU/Linux
>
>
> This may have been lost into the discussion but whether
this is a bug or not, the first argument of printf is a formatting string
where some
special chars are interpreted and thus you should avoid putting data there,
ie in your case:

 printf  "%s",$2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]