|
Oct 20, 1988:
Fixed %c: if expr is numeric, use numeric value;
otherwise print 1st char of string value. still
doesn't work if the value is 0 -- won't print \0.
This bugged me because it prevents awk from being a general-purpose
decimal to bytestream converter (also GNU awk gets this right.)
Look in /usr/share/man/cat4/sun3/leds.0 and you see:
# echo 0 0 0 5 0 0 0 8 254 253 250 247 239 223 175 127 |
awk '{ for (i=1;i<=NF;i++) printf("%c",$i+0); }' > /dev/leds
This used to fail since "0" did not produce a \0 on stdout.
It doesn't make any sense to me to fix awksprintf() the same way I did
awkprintf() since sticking a \0 in a string ends it.
|