[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Hex to ASCII conversion?
From: |
linuxCowboy |
Subject: |
Hex to ASCII conversion? |
Date: |
Wed, 14 Jan 2015 19:13:41 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20120613 Icedove/3.0.11 |
Hi Bob!
> Is there any way to use the shell printf like the C printf and do
this conversion in the coreutils printf? Or perhaps another way?
I use a shell alias with perl as "hexer":
alias hx='perl -ne'\''printf "%*vX\n"," ","$_"'\'
alias hxr="perl -ne'for(split){print chr hex}'"
4058 0 /tmp $ echo 48 61 70 70 79 A | hxr
Happy
4059 0 /tmp $ echo Happy | hx
48 61 70 70 79 A
greets,
LxC
- Hex to ASCII conversion?,
linuxCowboy <=