command or script for converting hex values to text

Tony Nelson tonynelson at georgeanelson.com
Fri Sep 22 17:14:52 UTC 2006


At 9:35 AM +0200 9/22/06, Mogens Kjaer wrote:
>ankush grover wrote:
>  > hey friends,
>  >
>  > Is there any command on linux which converts the hexadecimal values to
>  > text.
>
>What do you mean by "text"?
>
>I have the following aliases:
>
>alias calc 'gawk "BEGIN{ print \!* }"'
>alias hcalc 'gawk -v CONVFMT="%x\n" "BEGIN{printf CONVFMT, \!* }"'

FWIW, in bash:

function calc() { gawk "BEGIN{ print $* }"; }
function hcalc() { gawk -v CONVFMT="%x\n" "BEGIN{printf CONVFMT, $* }"; }

(Assuming that I retyped it correctly.)
-- 
____________________________________________________________________
TonyN.:'                       <mailto:tonynelson at georgeanelson.com>
       '                              <http://www.georgeanelson.com/>




More information about the fedora-list mailing list