Richard W.M. Jones
2014-Aug-24 10:51 UTC
Re: [Libguestfs] [PATCH] v2v: adding input -i ova
On Sun, Aug 24, 2014 at 11:48:09AM +0100, Richard W.M. Jones wrote:> printf "hash = \"%s\"\n" hash; > printf "sha1 = \"%s\"\n" sha1;Or even better: printf "hash = %S\n" hash; printf "sha1 = %S\n" sha1; %S (capital S) causes the compiler to print escape sequences for non-printable characters. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
On 24.08.14 11:51, Richard W.M. Jones wrote:> On Sun, Aug 24, 2014 at 11:48:09AM +0100, Richard W.M. Jones wrote: > > printf "hash = \"%s\"\n" hash; > > printf "sha1 = \"%s\"\n" sha1; > > Or even better: > > printf "hash = %S\n" hash; > printf "sha1 = %S\n" sha1;yes it have \r in end end of the sha1 which need to be trim: hash = "6b109c761f67ff2fee123b435d25df71259e81d7" sha1 = "6b109c761f67ff2fee123b435d25df71259e81d7\r"> > %S (capital S) causes the compiler to print escape sequences for > non-printable characters. > > Rich. > > -- > Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones > Read my programming and virtualization blog: http://rwmj.wordpress.com > virt-p2v converts physical machines to virtual machines. Boot with a > live CD or over the network (PXE) and turn machines into KVM guests. > http://libguestfs.org/virt-v2v
Richard W.M. Jones
2014-Aug-24 11:43 UTC
Re: [Libguestfs] [PATCH] v2v: adding input -i ova
On Sun, Aug 24, 2014 at 02:34:14PM +0300, Shahar Havivi wrote:> On 24.08.14 11:51, Richard W.M. Jones wrote: > > On Sun, Aug 24, 2014 at 11:48:09AM +0100, Richard W.M. Jones wrote: > > > printf "hash = \"%s\"\n" hash; > > > printf "sha1 = \"%s\"\n" sha1; > > > > Or even better: > > > > printf "hash = %S\n" hash; > > printf "sha1 = %S\n" sha1; > yes it have \r in end end of the sha1 which need to be trim: > hash = "6b109c761f67ff2fee123b435d25df71259e81d7" > sha1 = "6b109c761f67ff2fee123b435d25df71259e81d7\r"Probably fixing the regexp could remove that, ie. adding \r? somewhere. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top