title: Convert Hex STDIN / ARGV / gets to ASCII in ruby
body: <p>my Question is how I can convert the STDIN of cmd ARGV or gets from hex to ascii</p>
  
  <p>I know that if I assigned hex string to variable it'll be converted once I print it</p>
  
  <p>ex</p>
  
  <pre><code>hex_var = "\x41\41\x41\41"
  puts hex_var
  </code></pre>
  
  <p>The result will be </p>
  
  <blockquote>
    <p>AAAA</p>
  </blockquote>
  
  <p>but I need to get the value from command line by (ARGV or gets)</p>
  
  <p>say I've this lines </p>
  
  <pre><code>s = ARGV
  
  puts s
  # another idea
  puts s[0].gsub('x' , '\x')
  </code></pre>
  
  <p>then I ran </p>
  
  <pre><code>ruby  gett.rb \x41\x41\x41\x41 
  </code></pre>
  
  <p>I got </p>
  
  <blockquote>
    <p>\x41\x41\x41\x41</p>
  </blockquote>
  
  <p>is there a way to get it work ?</p>