Teemu Räikkönen wrote:
> While for example you get stdin from ssh piped and there's linefeed after
> value, the gawk makes replace chars from the start of line printed out with
> print. For example if you print from input "100" with '{ print "value.from "
> $1 "000" }' that does not print correct value.from 100000 but 000ue.from 100

I am not the maintainer but another interested person trying to help.
I read your message very closely but I am sorry that I was unable to
understand it.

> So for example this:
>  ssh -q -o "StrictHostKeyChecking no" munin@10.0.0.254 ipv6 fire conn print 
> count | awk '{ print "IPv6.value " $1 "000" }'
> prints out wrong line "0006.value 535"

What is the output of the ipv6 command?

> but
>  ssh -q -o "StrictHostKeyChecking no" munin@10.0.0.254 ipv6 fire conn print
> count |sed 's/.$//g'| awk '{ print "IPv6.value " $1 "000" }'
> gives correct "IPv6.value 585000"

Without knowing what input is going into the awk command it is
impossible to know if what awk is printing is correct or incorrect.

Could you show us the input to awk that produces that output?  If the
output is small then please attach it to the bug.  With that input
data we can recreate the problem case.

Otherwise it is best is to use something like this below example:

  $ printf "one two\r\n" | od -Ax -tx1z -v
  000000 6f 6e 65 20 74 77 6f 0d 0a                       >one two..<

  $ printf "one two\n" | awk '{ print "IPv6.value " $1 "000" }'
  IPv6.value one000

  $ printf "one two\r\n" | awk '{ print "IPv6.value " $1 "000" }'
  IPv6.value one000

This looks correct to me.  If you a test case like this or show us
your input data then we could recreate it and know what is happening.

Bob

Attachment: signature.asc
Description: Digital signature

Reply via email to