[yocto] [meta-raspberrypi] du giving non-integer result?

Daniel. danielhilst at gmail.com
Fri Sep 25 08:00:47 PDT 2015


Why not printf?

[geckos at csi24 ~]$ echo 1.0 | awk '{ printf("%d\n", $1); }'
1

Cheers,
- dhs

2015-09-25 11:12 GMT-03:00 Dave Wolaver <davewolaver at gmail.com>:

> Michael Fainstein <Michael.Fainstein at ...> writes:
>
> >
> > I saw such behavior in 'expr' when I upgraded bash 3.1 - it started
> printing floats instead of integers.
> > You can solve it using awk's OFMT:  awk '{OFMT="%.0f";print $1}'
> >
> > Michael
> >
>
>
> This worked for me, but it needed one small tweak... Need to add +0 so
> that awk actually applies the format.
>
> You can solve it using awk's OFMT:  awk '{OFMT="%.0f";print $1+0}'
>
> Thanks Michael!
>
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>



-- 
*"Do or do not. There is no try"*
  *Yoda Master*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20150925/e168eeb3/attachment.html>


More information about the yocto mailing list