I'm working in an embedded environment which has python
but not bc
. I had a need to convert a hex number from stdin into a decimal value.
I have found a solution and I'm suspecting that others might also be interested in a solution for this simple task.
So lets say I want something like this:
$ echo "ff" | [something in python]
255