Trying to take a character in a variable and change it to ascii value. Found a thread wher Ygor replied with the following:
read
echo $REPLY| od -b | read x y z
let ASCII=8#${y}
echo $ASCII
This converts the value you enter to a number but I cannot figure out the commands that is doing the work. What is the od -b in line 2 and what is line 3 doing. Can someone please explain?
thanks in advance.
read
echo $REPLY| od -b | read x y z
let ASCII=8#${y}
echo $ASCII
This converts the value you enter to a number but I cannot figure out the commands that is doing the work. What is the od -b in line 2 and what is line 3 doing. Can someone please explain?
thanks in advance.