I\'m now doing it this way:
[root@~]# echo Aa|hexdump -v
0000000 6141 000a
0000003
[root@~]# echo -e \"\\x41\\x41\\x41\\x41\"
A
Finally got the correct thing
echo "Hello, world!" | tr -d '\n' | xxd -ps -c 200
Text2Conv="Aa"
for letter in $(echo "$Text2Conv" | sed "s/\(.\)/'\1 /g");do printf '%x' "$letter";done
4161
The trick is using sed to parse the Text2Conv to format we can then seperate anf loop using for.
according to http://mylinuxbook.com/hexdump/ you might use the hexdump format parameter
echo Aa | hexdump -C -e '/1 "%02X"'
will return 4161
to add an extra linefeed at the end, append another formatter.
BUT: the format given above will give multiplier outputs for repetitive characters
$ printf "Hello" | hexdump -e '/1 "%02X"'
48656C*
6F
instead of
48656c6c6f