Unix – Fetching ASCII Code of any Character and Character Value from the ASCII Code

By -

This is the demo of fetching ASCII code of any character value and vice versa (Character value from the ASCII Code).

The below is the demo for the “A” and “65”.

Ascii value of character:
It can be done in 2 ways:

  1. printf “%d” “‘A”
  2. echo “A” | tr -d “n” | od -An -t dC

Character value from Ascii:

awk -v char=65 ‘BEGIN { printf “%cn”, char; exit }’

Paresh Mayani

Lazy android developer, exploring the horizon of android development since 7 years, currently working as a Technical Lead - Android at Simform Solutions, India. Former Application Architect at KarConnect. He is the Head/Organizer of Google Developers Group (GDG), Ahmedabad

Loading Facebook Comments ...
Loading Disqus Comments ...