hello, I am looking for a way to convert a word in hexa octa and decimal by the command echo and back again, in the example I only found printf.
greetings
Code:
st0="test"
for ((z=0; z<${#st0}; z++)); do a+=$(printf %0x \'${st0:$z:1}); done; st1=$a; unset a; unset z
echo $st1
for ((z=0; z<${#st1}; z+=2)); do a+=$(printf \\x${st1:$z:2}); done; st2=$a; unset a; unset z
echo $st2
greetings