title: Can printf "%x\n" \'a be performed in awk?
body: <p>All printable characters' hex code values can be displayed this way in bash.</p>
  
  <pre><code>printf "%x\n"  \'a
  61
  
  awk 'BEGIN{printf("%x\n",\\'a)}'
  awk 'BEGIN{printf("%x\n",\'a)}'
  </code></pre>
  
  <p>None of them can be performed in awk,is there no way to do in awk?<br>
  awk doesn't provide this kind of printf format such as in bash?</p>
  
  <pre><code>awk -v var="a"  'BEGIN{printf("%x\n", var)}'
  0
  echo -n  a|xxd
  0000000: 61   
  </code></pre>
  
  <p>It is simple to get the <strong>a</strong> printable characters' hex code value with    <strong>echo -n  a|xxd</strong>,my question is to ask  does awk provide this kind of printf format such as in bash or not ,not about how to get the hex code value with other method in awk.  </p>
  
  <pre><code>awk -v var="a"  'BEGIN{printf("%x\n", \'var)}'
  bash: syntax error near unexpected token `)'
  debian8@debian:~$ awk -v var="a"  "BEGIN{printf("%x\n", \'var)}"
  awk: cmd. line:1: BEGIN{printf(%xn, \'var)}
  awk: cmd. line:1:              ^ syntax error
  awk: cmd. line:1: BEGIN{printf(%xn, \'var)}
  awk: cmd. line:1:                   ^ backslash not last character on line
  awk: cmd. line:1: BEGIN{printf(%xn, \'var)}
  awk: cmd. line:1:                   ^ syntax error
  </code></pre>
  
  <p>Conclusion:awk doesn't support this kind of printf format.  </p>