Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

character to ascii conversion

Status
Not open for further replies.

wdellin

MIS
Feb 8, 2002
36
US
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.

 
thanks stefanwagner,sometimes the obvious is overlooked.

I'll check it out.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top