<?xml version="1.0" encoding="windows-1252"?>
<node id="499925" title="Re^2: How to remove an apostrophe?" created="2005-10-13 11:04:26" updated="2005-10-13 07:04:26">
<type id="11">
note</type>
<author id="5842">
PrakashK</author>
<data>
<field name="doctext">
&lt;i&gt;
&lt;code&gt;
map {printf"%3d %2x %2s|",$_,$_,$_&lt;32?'^'.chr$_+64:$_&lt;127?chr$_:'^?'} (0..127);
&lt;/code&gt;
&lt;/i&gt;

&lt;p&gt;Cool (and useful) one-liner, replacing &lt;code&gt;man ascii&lt;/code&gt;!&lt;/p&gt;

&lt;p&gt;I added it to my &lt;code&gt;~/.bash/functions&lt;/code&gt;, with a few changes replace the quote chracters so it would be acceptable to bash. Also, added a newline for every 8 characters.&lt;/p&gt;
&lt;code&gt;
function ascii
{
    perl -e '
        map {
            printf q{%3d %2X %2s|%s}, $_, $_,
                $_&lt;32 ? q{^}.chr($_+64) : $_&lt;127 ? chr : q{^?},
                ($_+1)%8 ? q{} : $/
        } 0..127
    '
}
&lt;/code&gt;

&lt;p&gt;/prakash&lt;/p&gt;

&lt;p&gt;PS: I tried making it a bash alias, but it was too much trouble working around all those quotes to prevent bash interpolating $_ etc!&lt;/p&gt;</field>
<field name="root_node">
499630</field>
<field name="parent_node">
499646</field>
</data>
</node>
