Hi, can echo in awk be used to convert a hexadecimal number into a character?
These are my four attempts that work without the variable indentation from $0.
Code: Select all
echo "61" | awk '{print | "echo \\\x"$0""}'
# echo "61" | awk '{print | "echo \\\x61"}'
echo "61" | awk '{system("echo \\\x"$0"")}'
# echo "61" | awk '{system("echo \\\x61")}'
echo "61" | awk '{print | eval "echo \\\x"$0""}'
# echo "61" | awk '{print | eval "echo \\\x61"}'
echo "61" | awk '{system("bash -c '\''echo \\\x"$0"'\''")}'
# echo "61" | awk '{system("bash -c '\''echo \\\x61'\''")}'
echo "61" | awk '{eval "read a<<<$(echo -e \\\x"$0")"; print $a}'
The last would be a redirect but I don't know how the variable can be routed from awk and back in.