On 7/3/20 8:06 AM, Alberto Garcia wrote:
+ printf -v expected_bitmap "%llu" $expected_bitmap # Convert to unsigned
Does the length modifier “ll” actually do anything?
+
+ printf "L2 entry #%d: 0x%016lx %016lx\n" "$entry_no" "$entry" "$bitmap"
Or the “l” here?
Actually they don't (I just tested in i386 and x86_64), I assumed that
it would require the length modifiers like in C.
I'm tempted to leave them for clarity (using 'll' in both cases),
opinions?
POSIX doesn't require support for modifiers; %d and %lld are the same
even in 32-bit bash. If this is a #!/bin/bash script, then use it for
clarity; if it is #!/bin/sh, omit it for portability.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org