<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>In the interest in not propagating misinformation, I wanted to correct a misstatement in the January talk, and I have made the correlating corrections to the slides.</div><div><br></div><div>The lack of support for \t (and other \encoded values) was reported to me a few days prior to the talk, I should have looked further into this prior to having made comments in the talk and using:</div><div><br></div><div>FS=sprintf("%c", 9);</div><div><br></div><div>Instead of:</div><div><br></div><div>FS="\t";</div><div><br></div><div>While playing around with C's printf recently, I discovered that the lack of support "bug" that was reported to me was really a misunderstanding of where the decoding from \values happens. The reported bug, I'm pretty sure was the result of something like:</div><div><br></div><div>echo "\t" | awk '{ printf("%s", $1); }'</div><div><br></div><div>Which will print a literal "\t". Decoding is actually done when a \encoded value occurs in a constant, and is not a feature of printf. If awk encounters a literal "\t" in a stream, or otherwise non-constant, it treats it as a literal \t, not an encoded TAB. This is consistent with C's behavior:</div><div><br></div><div><div><div>#include <stdio.h></div><div>int</div><div>main() {</div><div> static char e[3] = {'\\', 't', '\0'};</div><div> return (-1 == printf(e) || -1 == printf("%s", e)); /* show that printf does not decode literal \t in fmt or replace */</div><div>}</div></div></div><div><br></div><div>This will generate a warning with clang at compile time (cc doesn't seem to mind that ``e'' is not string literal), but is a good demonstration of the fact that \expansion is not a feature of printf. Anyway, apologies for the misinformation.</div><div><br></div><div>On Jan 5, 2012, at 10:48 PM, mikel king wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 5, 2012, at 10:40 PM, Matthew Story wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">the useless use of head, reminds me of my favorite quote from The UNIX Programming Environment ...<div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 9.8px/normal Times; color: rgb(61, 63, 55); "><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px; "> With these ideas, it might seem sensible </span></font><span style="color: #2b2e26"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">to </span></font></span><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">write a program, called </span></font><span style="font: 10.1px Times; color: #2b2e26"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">head, </span></font></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 9.8px/normal Times; color: rgb(61, 63, 55); "><span style="font: 10.1px Times; color: #2b2e26"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;"></span></font></span><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;"> to print the first few lines </span></font><span style="font: 9.9px Times"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">of </span></font></span><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">each filename argument. But </span></font><span style="font: 10.3px Times"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">sed </span></font></span><span style="font: 9.9px Times; color: #2b2e26"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">3q </span></font></span><span style="color: #2b2e26"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">(or </span></font></span><span style="font: 9.5px Times; color: #2b2e26"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">10q) </span></font></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 9.8px/normal Times; color: rgb(61, 63, 55); "><span style="font: 9.5px Times; color: #2b2e26"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;"></span></font></span><span style="font: 9.6px Times"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;"> is </span></font></span><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">so easy to type </span></font><span style="font: 9.9px Times"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">that </span></font></span><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">we</span></font><span style="color: #5b5c53"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">'</span></font></span><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">ve never felt </span></font><span style="color: #2b2e26"><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">the </span></font></span><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;">need.</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 9.8px/normal Times; color: rgb(61, 63, 55); "><font class="Apple-style-span" face="Courier" size="3"><span class="Apple-style-span" style="font-size: 12px;"> ~ p.124</span></font></div></div></div></blockquote></div><br><div>=))</div><div><br></div><div>Love it thanks for sharing...</div><div><br></div><div>m</div></div></blockquote></div><br></body></html>